
# informational
git status
git log
# Checkout master and pull
git checkout master
git pull
#Sync staging
git checkout master
git pull
git checkout staging
git pull
git merge master
#Reset current changes to state of master on remote origin
git reset origin/master
# Merge `feature` brach to `master` branch
git checkout master
git pull
git merge feature
# if there are conflicts you need to solve it, then:
git add <file_with_conflict_resolved>
git merge --continue
# Update `feature` branch to use updated `master` as base
git checkout master
git pull
git checkout feature
git rebase master
# if there are conflicts you need to solve it, then:
git add <file_with_conflict_resolved>
git rebase --continue
# Apply the changes introduced by some existing commits
git cherry-pick <commit>
# Revert 4 commits
git revert HEAD~3