Once:
- Create git repository, invite collaborators
- Someone commits initial version, everyone else clones it
Day to day:
git checkout -b my_branch
my_branch could be your name or feature you are currently working on. You are now working in your own private branch
-
Do some work on this branch committing early and often (for instance, whenever your tests pass). Rebase against the upstream frequently to prevent your branch from diverging significantly:
-
git fetch origin master
-
git rebase master
-
When done, commit ...
-
git commit -a -m "a useful comment"
Commits changes to your local repo/branch. Option -a commits all changed files.
-
time to merge and push ...
-
git checkout master
Check out 'master' which implicitly switches you back to master branch
git merge my_branch
Syncs your branch with master (locally)
git push origin master
Push to github. Start over ... :-)