Skip to content

CTI-One/git-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Git / GitHub for development basics

Git:

  • distributed version control system
  • originally authored by Linus (of Linux fame)
  • UNIX philosophy of many small chainable tools

Github:

  • online hosting for git repositories
  • CI, issues, merging, forking, releases, remote

Why are Git / Github important for development?

  • Contributing to open source
  • Literacy
  • Bug finding
  • Code health

What is distributed version control?

Diagram showing that distributed version control users all have a copy of the repository, versus centralized where only one copy exists on the server

Pros
  • Redundancy
  • Independent working
  • Local = fast
  • Offline
Cons
  • Stale checkouts
  • Manual merging

Some basic terminology

Github is a remote, which hosts the remote repo. The act of creating your local checkout is called cloning. Commits are changesets. When you and someone else have conflicts, merging creates a commit to resolve those conflicts. When you rebase, you temporary remove your commits, update or fast-forward the branch they're on, and re-apply your commits.

Exercise

Installing Git

Ubuntu

sudo apt install git-all

More info here

Getting Started

git clone [email protected]:cti-one/git-demo.git

High level workflow

  1. Get most recent changes
git pull --rebase

A regular pull:
Diagram showing commits for a regular pull from git
A rebase pull:
Diagram showing commits for a regular pull from git
2. Commit changes

git commit -m 'message'
  1. Push changes
git push

What's next?

  • Communication
  • Feature branching (optional)
  • Use the organization, email me for help

Further Reading

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published