Open Bisllly opened 1 year ago
Disable rebasing when pulling the changes from remote branch Git config pull.rebase false
Make your local doesn’t have changes when merging (pulling) from remote Git pull origin main _ git fetch origin main && git merge origin main
If local still have changes that are un-tracked. Git stash -m “this is a not, squash me later”
- Store current changes into stack list
Resolve conflict if have. Then
git stash pop
to take out the stored changesThen commit your changes > Create PR
To create a new Git branch to manage changes before merging, you can follow these steps:
git branch
command to check your current branch and switch to the desired branch usinggit checkout <branch-name>
.git branch <new-branch-name>
command to create a new branch. For example,git branch feature-branch
.git checkout <new-branch-name>
. In our example,git checkout feature-branch
.git add
, and commit them usinggit commit
.git checkout <original-branch-name>
.git merge <new-branch-name>
command to merge the changes from the new branch to the original branch.git branch -d <new-branch-name>
.Following these steps will allow you to create a new branch, make changes specific to that branch, and merge them back into the original branch when you're ready.