A bunch of useful commands and tips for using git.
Create a new branch
git branch my_branch
Make your changes, add files and commit them to your branch. Then push them to remote
git push origin my_branch
git checkout master
git remote add upstream git@github.com:upstreamname/projectname.git
Now you can get updates from upstream
git fetch upstream
git merge upstream/master
To send these changes to your own remote
git push origin master
git checkout masterÂ
git pull origin master
git pull upstream master
git checkout my_branch
git rebase master
The last step might indicate some conflicts which have to be resolved.
git branch -D my_branch
git push origin :my_branch
git checkout master
git remote add contributor git://github.com/contributor/projectname
git fetch contributor
git merge contributor/newfeature
git push origin master