Git Command

pleng
Nov 22, 2022

--

  1. Get commit in same branch from remote to local and force push to remote
git pull --rebase
git push --force

2. Rebase commit in other branch from remote to local and force push to remote

git pull --rebase origin/master
git push --force

3. Rebase from other branch and specific commit which rebase

git rebase --onto <other branch name> <other branch commit>
git push --force

4.Squash commit

git rebase -i <commit which begin squash>
and edit pick to squash all commit except fisrt

--

--