CM(ConfigurationManagement)/git

[git] 2.Create a branch

리딩리드 2016. 5. 8. 22:02

Create a branch


1. Why do we use branches?

- We can handle many problems (to fix bugs, add a function etc..) at the same time


2.  git branch

- (*) is a current branch


3. git checkout -b

- Create and change

3_1. To create a feature-A branch

- Same way

git branch feature-A (Create)

git checkout feature-A (Move to feature-A from master)    

- commit as a feature-A


3_2. Change branch to master

- git checkout master

- git checkout -


4. Topic branch

- For example feature-A branch topic is about adding a new function

- One branch has a one topic


5. Merge branch

- Usually, Master branch is merge branch

 

5_1. git merge


6. git log --graph

- Check branches visually