serendipity
Git 명령어 2 본문
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
Comments