모든 도구
무료

검색하고 인쇄할 수 있는 Git 참조 자료——설정, 브랜치, 병합, 리베이스, 원격 저장소, 스태시, 태그, 변경 취소. 무료.

Setup & config

10
git config --global user.name "Jane Doe"
Set the name attached to your commits
git config --global user.email "jane@example.com"
Set the email attached to your commits
git config --global init.defaultBranch main
Make new repos start on a "main" branch
git config --global core.editor "code --wait"
Use VS Code as the default Git editor
git config --global pull.rebase true
Rebase instead of merge when pulling
git config --global alias.co checkout
Create a shortcut alias (git co)
git config --global --list
List all global configuration values
git config user.email
Print the email for the current repo
git config --global color.ui auto
Enable colored command-line output
git help <command>
Open the manual page for a command

Create & clone repos

9
git init
Initialize a new repo in the current folder
git init my-project
Create a new repo in a new directory
git clone https://example.com/repo.git
Clone a remote repo over HTTPS
git clone git@example.com:user/repo.git
Clone a remote repo over SSH
git clone <url> my-dir
Clone into a specific directory name
git clone --depth 1 <url>
Shallow clone with only the latest commit
git clone --branch dev <url>
Clone and check out a specific branch
git clone --recurse-submodules <url>
Clone and initialize all submodules
git remote add origin <url>
Attach a remote to an existing local repo

Staging & committing

11
git add file.txt
Stage a single file for the next commit
git add .
Stage all changes in the current directory
git add -A
Stage all changes including deletions
git add -p
Interactively stage selected hunks
git commit -m "Add login form"
Commit staged changes with a message
git commit -am "Fix typo"
Stage tracked files and commit in one step
git commit --amend
Edit the most recent commit
git commit --amend --no-edit
Add staged changes to the last commit
git rm file.txt
Remove a file and stage the deletion
git mv old.txt new.txt
Rename or move a file and stage it
git reset file.txt
Unstage a file but keep its changes

Branches

10
git branch
List all local branches
git branch -a
List local and remote-tracking branches
git switch -c feature/login
Create a new branch and switch to it
git switch main
Switch to an existing branch
git checkout -b hotfix
Classic way to create and switch branches
git branch -m old-name new-name
Rename a branch
git branch -d feature/login
Delete a merged local branch
git branch -D feature/login
Force-delete an unmerged local branch
git push origin --delete feature/login
Delete a branch on the remote
git switch -
Switch back to the previous branch

Merging & rebasing

10
git merge feature/login
Merge a branch into the current one
git merge --no-ff feature/login
Merge and always create a merge commit
git merge --squash feature/login
Combine a branch into one staged change
git merge --abort
Cancel a merge with conflicts
git rebase main
Replay current branch commits onto main
git rebase -i HEAD~3
Interactively edit the last 3 commits
git rebase --continue
Resume a rebase after resolving conflicts
git rebase --abort
Cancel an in-progress rebase
git cherry-pick <hash>
Apply a single commit onto the current branch
git mergetool
Launch a tool to resolve merge conflicts

Remotes & syncing

11
git remote -v
List configured remotes and their URLs
git remote add upstream <url>
Add a second remote named upstream
git remote set-url origin <url>
Change the URL of an existing remote
git fetch
Download remote changes without merging
git fetch --all --prune
Fetch all remotes and drop stale branches
git pull
Fetch and integrate remote changes
git pull --rebase
Pull and rebase local commits on top
git push
Upload local commits to the remote
git push -u origin main
Push and set the upstream tracking branch
git push --force-with-lease
Safely force-push without clobbering others
git push origin --tags
Push all local tags to the remote

Inspecting & comparing

10
git status
Show staged, unstaged, and untracked files
git status -s
Show status in a compact short format
git diff
Show unstaged changes against the index
git diff --staged
Show changes staged for the next commit
git diff main..feature
Compare two branches
git diff HEAD~1 HEAD
Compare the last commit with its parent
git show <hash>
Show the details and diff of one commit
git show HEAD:file.txt
Show a file as it was in a commit
git log --stat
Show commits with changed-file summaries
git shortlog -sn
Count commits grouped by author

Undoing changes

10
git restore file.txt
Discard unstaged changes in a file
git restore --staged file.txt
Unstage a file but keep its changes
git restore --source=HEAD~1 file.txt
Restore a file from an earlier commit
git checkout -- file.txt
Classic way to discard local changes
git reset --soft HEAD~1
Undo last commit, keep changes staged
git reset --mixed HEAD~1
Undo last commit, keep changes unstaged
git reset --hard HEAD~1
Undo last commit and discard changes
git revert <hash>
Create a new commit that undoes a commit
git clean -fd
Delete untracked files and directories
git clean -nd
Preview what clean would remove

Stashing

10
git stash
Save uncommitted changes and clean the tree
git stash push -m "wip"
Stash changes with a descriptive message
git stash -u
Stash including untracked files
git stash list
List all stashed change sets
git stash show -p
Show the diff of the latest stash
git stash apply
Reapply the latest stash and keep it
git stash pop
Reapply the latest stash and drop it
git stash apply stash@{2}
Reapply a specific stash by index
git stash drop stash@{0}
Delete a single stash entry
git stash clear
Delete all stash entries

Tags

9
git tag
List all tags
git tag v1.0.0
Create a lightweight tag at HEAD
git tag -a v1.0.0 -m "Release 1.0.0"
Create an annotated tag with a message
git tag -a v1.0.0 <hash>
Tag a specific past commit
git show v1.0.0
Show details for a tag
git push origin v1.0.0
Push a single tag to the remote
git push origin --tags
Push all local tags to the remote
git tag -d v1.0.0
Delete a tag locally
git push origin --delete v1.0.0
Delete a tag on the remote

Logs & history

12
git log
Show the full commit history
git log --oneline
Show a compact one-line-per-commit log
git log --oneline --graph --all
Visualize branches as an ASCII graph
git log -p
Show commit history with diffs
git log --author="Jane"
Filter history by author
git log --since="2 weeks ago"
Filter history by date range
git log --pretty=format:"%h %an %s"
Customize the log output format
git blame file.txt
Show who last changed each line
git reflog
Show the history of where HEAD has been
git bisect start
Begin a binary search for a bad commit
git bisect good <hash>
Mark a commit as known-good during bisect
git bisect bad
Mark the current commit as bad

“:q”와 일치하는 항목이 없습니다.


Git 치트시트 소개

이 Git 명령어 치트시트는 버전 관리를 작업별로 정리했습니다: 설정, 저장소 생성과 복제, 스테이징과 커밋, 브랜치, 병합과 리베이스, 리모트와 동기화, 검사와 비교, 변경 취소, 스태시, 태그, 로그와 히스토리까지 포함합니다.

섹션은 실제로 Git에 관한 질문이 어떻게 생기는지를 그대로 반영합니다 — “이걸 어떻게 취소하지?”, “이 브랜치를 어떻게 옮기지?”, “이 커밋들 사이에 뭐가 바뀌었지?” — 그래서 필요한 명령어가 그 변형들과 함께 놓여 있고, 각각 무엇을 하는지, 언제 사용하는지 한 줄 설명이 있습니다.

이 시트는 무료이며 완전히 클라이언트 사이드로 동작합니다. 검색창으로 모든 명령어를 실시간 필터링하고, 고정된 목차로 섹션 간을 이동하고, 클릭 한 번으로 명령어를 복사하고, 페이지를 인쇄하세요 — 취소 섹션만으로도 벽에 붙여둘 가치가 있습니다.

Git 치트시트 사용 방법

  1. 설정부터 변경 취소, 로그와 히스토리까지 열한 개 섹션을 훑어보세요.
  2. rebase, stash, amend 같은 작업을 검색해 명령어를 실시간 필터링하세요.
  3. 고정된 사이드바를 통해 리모트와 동기화 같은 섹션으로 이동하세요.
  4. 명령어나 복사 아이콘을 클릭해 복사한 다음 실행하기 전에 브랜치나 리모트 이름을 조정하세요.
  5. 오프라인 Git 참고 자료로 시트를 인쇄하세요.

자주 묻는 질문

열한 개 섹션입니다: 설정, 저장소 생성과 복제, 스테이징과 커밋, 브랜치, 병합과 리베이스, 리모트와 동기화, 검사와 비교, 변경 취소, 스태시, 태그, 로그와 히스토리입니다.

네. 전용 변경 취소 섹션이 reset, restore, revert의 여러 형태를 설명과 함께 나란히 다루므로, 추측하는 대신 상황에 맞는 것을 고를 수 있습니다.

네. 병합 및 리베이스 섹션은 두 워크플로를 그 일반적인 변형들과 함께 보여주며, 브랜치와 리모트 섹션은 작업을 옮기는 데 필요한 주변 명령어를 다룹니다.

네. 명령어나 호버 시 나타나는 복사 아이콘을 클릭하면 바로 클립보드에 저장됩니다 — 브랜치, 리모트, 커밋 참조만 바꾸면 됩니다.

네, 완전히 무료입니다 — 브라우저에서 검색 가능하고 인쇄할 수 있으며 계정 없이 이용할 수 있습니다.


인기 검색어
git cheat sheet git commands list git rebase vs merge git undo last commit git reset vs revert git stash commands git branch commands git log options
도움이 필요하신가요?
이 도구에서 문제를 발견하셨나요? 저희 팀에 알려주세요.
문제 신고

이 무료 도구를 귀하의 웹사이트에 추가하세요 — 아래 코드를 복사하여 붙여넣으세요.