CM(ConfigurationManagement)/git

[git] 3. commit control

리딩리드 2016. 5. 9. 23:08

commit control


1. git reset

- restoration


1_1. To restore a feature-A

- I will restore that point and make a other branch fix-B

- after


1_2. To make a fix-B branch



1_3. git goes back to several times

- git reflog

- I can check a specific status of commit

- after


2. To solve a conflict problem

- There is a conflict issue


2_1. Confirm a README.md

- vi README.md

- HEAD : current content

- fix-B : it will be merged


2_2. commit


3. Modify commit message

- git commit --amend


3_1. Before


3_2. after


4. Handle the process that changed

- git rebase -i


4_1. Example

- There would be a spelling error about commit before Topic branch merge with master

in this case, we fix a commit and then overwrite the before commit

because spelling error is not important


4_2. Making branch feature-C


- I make a spelling error on purpose(README.md)


- If you want to commit quickly, follow the way


4_3. fix a spelling error


4_4. handle a process changed(Use the rebase)

- I have two commits, "Add feature-C" and "Fix typo"

  which means I had a mistake so I changed my source 

  I want to arrange these logs


- rebase


- I put 6748345 into a591862 


- confirm


- There is no Fix typo