250x250
Notice
«   2025/07   »
1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31
Today
Total
관리 메뉴

serendipity

Git 명령어 2 본문

Dev/Git

Git 명령어 2

z 2021. 8. 16. 15:27
728x90

🐱 < Working with Branches > 

 

 

List all local branches

$ git branch

 

List all branches, local and remote

$ git branch -av

 

Switch to a branch, my_branch, and update working directory

$ git checkout my_branch

 

Create a new branch called new_branch

$ git branch new_branch

 

Delete the branch called my_branch

$ git branch -d my_branch

 

Merge branch_a into branch_b

$ git checkout branch_b

$ git merge branch_a

 

Tag the current commit

$ git tag my_tag

 


🐰 <Make a change>

 

Stages the file, ready for commit

$ git add [file]

 

 

Stage all changed files, ready for commit

$ git add .

 

 

Commit all staged files to versioned history

$ git commit -m “commit message”

 

 

Commit all your tracked files to versioned history

$ git commit -am “commit message”

 

 

Unstages file, keeping the file changes

$ git reset [file]

 

 

Revert everything to the last commit

$ git reset --hard

 

 

 

728x90

'Dev > Git' 카테고리의 다른 글

Git 깃  (0) 2021.08.16
Git 명령어 3  (0) 2021.08.16
Git 명령어 1  (0) 2021.08.16
Comments