2025-05-21 14:08:50 +07:00

137 lines
2.6 KiB
Markdown

# USING FORK
---
### AMEND
**BEFORE**
You already push some file and want to add more to this commit.
![Add Symbol Texture](./img/amend-1.png)
Your local change
![Add Symbol Texture](./img/amend-2.png)
**AFTER**
You can see all file local change will appear in your commit.
![Add Symbol Texture](./img/amend-2.png)
#### Step1: Stage all your local change
![Add Symbol Texture](./img/amend-3.png)
#### Step2: Check Amend & Click Amend Last Commit
![Add Symbol Texture](./img/amend-4.png)
---
### REBASE
**BEFORE**
![Add Symbol Texture](./img/before.png)
**AFTER**
![Add Symbol Texture](./img/after.png)
#### Step1: Amend or Commit all your local change.
#### Step2: Right click rebase where you want
![Add Symbol Texture](./img/rebase-1.png)
#### Step2: Click rebase
![Add Symbol Texture](./img/rebase-2.png)
:::warning
If you missing step 1, this popup will appear. Back to step 1 and do it again.
![Add Symbol Texture](./img/rebase-3.png)
:::
#### 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**
![Add Symbol Texture](./img/drop-1.png)
**AFTER**
![Add Symbol Texture](./img/drop-4.png)
#### Step1: Amend or Commit all your local change.
#### Step2:
![Add Symbol Texture](./img/drop-2.png)
#### Step3:
![Add Symbol Texture](./img/drop-3.png)
#### 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.
![Add Symbol Texture](./img/resolve-conflic-3.png)
:::
When you meet this warning:
![Add Symbol Texture](./img/resolve-conflic-1.png)
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**
![Add Symbol Texture](./img/resolve-conflic-2.png)
---
### PUSH FAIL
![Add Symbol Texture](./img/push-fail-1.png)
If you see this image, It's mean you already push it.
![Add Symbol Texture](./img/push-fail-2.png)
**2 ways to fix it **
**Rebase to old commit** and resolve conflict to keep all file in old version.
![Add Symbol Texture](./img/push-fail-4.png)
**Force Push** to remove old version branch in git & using this branch like newest.
![Add Symbol Texture](./img/push-fail-3.png)