Some simple Git commands
git pull
git checkout -b [name_of_your_new_branch]
git push origin [name_of_your_new_branch]
git commit -am "commit message"
- Pull the latest staging/master branch to your machine
- Switch to your own branch
- Run
git rebase staging
- Next force push the changes of your branch
git push -f
It is a good practise to first create a backup of your own branch
- Run
git fetch
to get the latest changes - Next
git checkout -b <branch-name>
to create a new branch. - Run
git cherry-pick <first-commit-hash>^..<second-commit-hash>
To retrieve changes of other branch - At last run
git push -f
to forcefully push the changes