본문 바로가기

Git

Git 명령어 정리

08.06 TIL

 

Git 설치하기
 

Git - Downloads

Downloads macOS Windows Linux/Unix Older releases are available and the Git source repository is on GitHub. GUI Clients Git comes with built-in GUI tools (git-gui, gitk), but there are several third-party tools for users looking for a platform-specific exp

git-scm.com

 

Configure
• $ git config --global user.name "name"
• $ git config --global user.email "email address"
• $ git config --global color.ui auto
Branches
• $ git branch branch-name
• $ git checkout branch-name
• $ git merge branch
• $ git branch -d branch-name
Make changes
• $ git log
• $ git log --follow file
• $ git diff first-branch ... second-branch
• $ git show commit
• $ git add file
• $ git commit -m "descriptive message"
Redo commits
• $ git reset commit
• $ git reset --hard commit
Create repositories
• $ git init
• $ git remote add origin url
• $ git clone url
Synchronize changes
• $ git fetch
• $ git merge
• $ git push
• $ git pull

 

👀참고

Git Cheat Sheet
 

GitHub Git Cheat Sheet

Install GitHub Desktop desktop.github.com Git for All Platforms git-scm.com Configure user information for all local repositories $ git config --global user.name "[name]" Sets the name you want attached to your commit transactions $ git config --global use

training.github.com