Note: please use git manual to get to know what each git command is actually doing. Divide feature on which you are working in short working deliverables. That means when you are done with your implementation and unit testing, you can merge to master branch and delete your small feature branch.
mkdir ~/repos
cd repos
git clone git_repository
cd git_repository
git status
git checkout master
git pull --rebase
Start working on feature_name. Be sure that feature scope is small as possible. We want your contribution to master as soon as possible!
git branch -a
List of all repo branches, remote and local
git checkout -b feature_name
Creates feature branch with name feature_name from master branch
git status
git push -u origin feature_name
put feature branch to remote repo
git checkout feature_name
To be sure that you are in appropriate feature branch.
git add .
git commit -m 'something useful and funny'
git rebase -i @{u}
git push -u origin feature_name
git checkout master
git merge --no-ff feature_name
grep -H -r '<<<<<<< HEAD' * | less
-check for conflicts. Resolve them using your favourite editor
git add edited_file
-skip if there was no conflicts
git commit -m 'merge from to'
git rebase -i @{u}
git push -u origin master
More on that topic could be found here.
git push origin :feature_name
git branch -d feature_name
git remote prune origin
- in order to sync with origin for branches deleted from other computer!