2.6 KiB
USING FORK
AMEND
BEFORE
You already push some file and want to add more to this commit.
Your local change
AFTER
You can see all file local change will appear in your commit.
Step1: Stage all your local change
Step2: Check Amend & Click Amend Last Commit
REBASE
BEFORE
AFTER
Step1: Amend or Commit all your local change.
Step2: Right click rebase where you want
Step2: Click rebase
:::warning
If you missing step 1, this popup will appear. Back to step 1 and do it again.
:::
Step3: Finish.
:::warning With no conflict, you can see the result like image After.
If conflict, scroll down to check how to RESOLVE CONFLICT :::
DROP COMMIT
In this case: I want to create PullRequest merge to develop but only commit test2. My branch feature/test2 must split from develop and only have one commit test2.
BEFORE
AFTER
Step1: Amend or Commit all your local change.
Step2:
Step3:
Step4: Click rebase.
CONFLICT RESOLVE
:::warning Any time in this step, if you see many problem and can't resolve conflict. Click this button to exit what are you doing. And try another way.
:::
When you meet this warning:
Step1: Click Local Change Step2: Select version you want Step3: Click Choose :::warning If you have multi file conflict. All files will appear in Unstaged* You have to resolve all these files. :::
Step3: Click Continue Rebase
PUSH FAIL
If you see this image, It's mean you already push it.
**2 ways to fix it **
Rebase to old commit and resolve conflict to keep all file in old version.
Force Push to remove old version branch in git & using this branch like newest.