Git
Migrate my notes on Git from Google Keep to here
PR steps
- create fork in the console
git pull
andgit checkout -b new_branch
- modify/add/commit/push origin
git push --set-upstream origin new_branch
- create pull request
Sync your fork
-
git remote add upstream git@xxxxx
git fetch upstream
git checkout main
andgit merge upstream/main
push fetched to fork
git push
# to update- more modify/push
git brach -d new_branch
git push origin -d new_branch
( delete the one in the console)
Merge vs Rebase
More details at this link
git merge main
is a non-destructive operation. The existing branches are not changed in any way, and feature branch will have an extraneous merge commit every time you need to incorporate upstream changes.
git rebase main moves the entire feature branch to begin on the tip of the main branch, effectively incorporating all of the new commits in main. It re-writes the project history.
The golden rule of rebasing
Never use it on public branch. It will force main to get all commit from you, while others don’t need.