git workflow
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.
Clone repository (repository will be called repo furthermore in this wiki.)
mkdir ~/repos
cd repos
git clone git@github.com:karlosmid/repo_name.git
cd repo_name
Get latest code from remote
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 localgit checkout -b feature_name
Creates feature branch with name feature_name from master branchgit status
git push -u origin feature_name
put feature branch to remote repoDo your work in feature branch. Commit as much as possible.
git checkout feature_name
To be sure that you are in appropriate feature branch.git add .
git commit -m 'something useful and funny'
Send commits to remote repo branch
git rebase -i @{u}
git push -u origin feature_name
Code is ready for master after a lot of testing!
git checkout master
git merge --no-ff feature_name
grep -H -r '<<<<<<< HEAD' * | less
-check for conflicts. Resolve them using your favourite editorgit commit -m 'merge from to'
git rebase -i @{u}
git push -u origin master
More on that topic could be found here.
Thank, you feature_name branch, we are done! Your life must be shorter than butterflies!
git push origin :feature_name
git branch -d feature_name