-
Notifications
You must be signed in to change notification settings - Fork 41
Useful git commands workflows
Amaury Dehecq edited this page Apr 27, 2023
·
1 revision
git rebase
will rewrite the commits, this is to be used with caution, but prevents from adding merge commits every time which would make your fork diverge from upstream...
git checkout main
git fetch upstream main
git rebase upstream/main
git checkout -b yournewbranch
git push --set-upstream origin branch_name
git checkout main
git branch -d branch_name # delete your local branch
git push origin --delete branch_name # Delete the remote branch
git fetch --all --prune
Warning! This will delete all local commits that are not in remote !
git checkout main
git reset --hard upstream/main
git push -f