GIT
GIT copied to clipboard
๐ GIT ์ฌ์ฉ๋ฒ์ ๋ฐฐ์ ๋ด ์๋ค ๐ฅ
๐GIT ์ฌ์ฉ๋ฒ๐ฐ
Contents
-
GIT์ ์ฌ์ฉํ๊ธฐ ์ํ ์ค๋น๐พ
-
git --version
-
-
GIT ์ค์ ํ๊ธฐ๐
-
git config --global user.name "์ด๋ฆ"
-
git config --global user.email "์ด๋ฉ์ผ"
-
git config --global --edit"
-
git config --global core.autocrlf input
(Mac) -
git config --global core.autocrlf true
(Window) -
git config --global core.editor "xed --wait"
(Xcode) -
git config --global core.editor "code --wait"
(Visual Studio Code)
-
-
-
GIT ์์ฑํ๊ณ ์ญ์ ํ๊ธฐ๐
-
git init
-
rm -rf .git
-
-
Working Directory์์ ํ์ผ Track ๋๋ Untrack ํ๊ธฐ๐โจ
-
git add ํ์ผ๋ช
-
git add .
-
-
git rm --cached ํ์ผ๋ช
-
echo ํ์ผ๋ช > .gitignore
-
echo *.log > .gitignore
-
-
git status
-
git status -s
-
-
-
Staging Area์์ Track๋ ํ์ผ์ ๋ณ๊ฒฝ์ฌํญ ํ์ธํ๊ธฐ๐
-
git diff
-
git diff --staged
-
-
git difftool
-
[diff] tool = vscode
[difftool "vscode"] cmd = code --wait --diff $LOCAL $REMOTE
-
-
-
Commitํ์ฌ GIT์ ์ ์ฅํ๊ณ , ๋ถ๋ฌ์ค๊ธฐ๐ฅ๐ค
-
git commit -m "์ปค๋ฐ ๋ฉ์์ง"
-
git log
-
git log --oneline --graph --all
-
-
git checkout ํด์์ฝ๋
-
-
Alias๋ฅผ ์ด์ฉํ์ฌ ๋๋ง์ ๋จ์ถ ๋ช
๋ น์ด๋ฅผ ์ฌ์ฉํ์โ
-
git config --global alias.๋ช ๋ น์ด "๋จ์ถํ ๋ช ๋ น์ด"
-
git log --pretty=๋ช ๋ น์ด
-
-
Log๋ฅผ ์ด์ฉํด ํ์คํ ๋ฆฌ ์กฐํํ๊ธฐ(์ฌํ)๐
-
git log ๋ช ๋ น์ด
-
git log -์ซ์
-
git log --before="๋ ์ง"
-
git log --author="์ด๋ฆ"
-
git log --grep="์ปค๋ฐ ๋ฉ์์ง"
-
git log -S "ํ์ผ๋ช "
-
-
-
[Control-Z] ๋๋๋ฆฌ๊ธฐโฉ
-
git commit --amend
-
git restore -- ํ์ผ๋ช
-
-
Tag๋ฅผ ์ด์ฉํด ๊ฐ๋จํ๊ฒ ๋ฒ์ ํ์ํ๊ธฐโ
-
git tag
-
git tag -l ํ๊ทธ๋ช
-
git tag -d ํ๊ทธ๋ช
-
-
git tag ํ๊ทธ๋ช
-
git tag ํ๊ทธ๋ช ํด์์ฝ๋ -a -m "ํ๊ทธ ๋ฉ์์ง"
-
-
git show ํด์์ฝ๋
-
git show head --name-only
-
-
-
Branch๋ฅผ ์ด์ฉํด ๋
๋ฆฝ๋ ๊ณต๊ฐ์์ ๋๋ง์ ์์
๊ณต๊ฐ์ ๋ง๋ค์๐
-
git branch
-
git branch -v
-
git branch -all
-
git branch --merged
-
git branch --no-merged
-
-
git branch ๋ธ๋์น๋ช
-
git switch -C ๋ธ๋์น๋ช
-
-
git branch --move ๋ธ๋์น๋ช ๋ฐ๊ฟ๋ธ๋์น๋ช
-
git branch -d ๋ธ๋์น๋ช
-
-
Merge! ํ๋์ Branch๋ก ๋ณํฉํ๊ธฐ๐
-
git merge ๋ธ๋์น๋ช
-
git merge --no-ff
-
-
-
Merge Conflict์ Merge Tool๐งท
-
git merge --abort
-
git merge --continue
-
git mergetool
-
[merge] tool = vscode
[mergetool "vscode"] cmd = code --wait $MERGED
-
-
-
Rebase์ Cherry-Pick๐
-
git rebase ๋ธ๋์น๋ช
-
git rebase ๋ธ๋์น๋ช ๋ธ๋์น๋ช
-
git rebase --onto ๋ธ๋์น๋ช ๋ธ๋์น๋ช ๋ธ๋์น๋ช
-
git rebase --abort
-
git rebase --continue
-
-
git cherry-pick ํด์์ฝ๋
-
-
GIT ๋๊ตฌ - Stash, Cleanโ
-
git stash push -m "์คํ์ ๋ฉ์์ง"
-
git stash
-
git stash -u
-
git stash --keep-index
-
-
git stash list
-
git stash show ์คํ์
-
git stash show ์คํ์ --patch
-
-
git stach apply ์คํ์
-
git stash pop ์คํ์
-
-
git stash drop ์คํ์
-
git stash clear
-
-
git stash branch ๋ธ๋์น๋ช
-
git clean
-
git clean -fd
-
git clean -x
-
git clean -d -n
-
-
-
Reset์ผ๋ก ๋๋์๊ฐ๊ธฐโฎ
-
git reset
-
git reset --soft ํด์์ฝ๋
-
git reset --hard ํด์์ฝ๋
-
-
git restore --source=ํด์์ฝ๋ ํ์ผ๋ช
-
git revert ํด์์ฝ๋
-
-
GIT ๋๊ตฌ - RefLog๐
-
git reflog
-
git reflog expire --expire=์๊ฐ --all
-
-
git show HEAD@{์ซ์}
-
git show ๋ธ๋์น๋ช @{์๊ฐ}
-
-
Rebase -i ์ต์
์ผ๋ก Commit ์์ ํ๊ธฐโ
-
git rebase -i
-
git rebase --abort
-
git rebase --continue
-
-
-
GIT ๋๊ตฌ - GIT์ผ๋ก ๋ฒ๊ทธ์ฐพ๊ธฐ(Blame, Bisect)๐
-
git blame ํ์ผ๋ช
-
git blame -C -L ์ซ์,์ซ์ ํ์ผ๋ช
-
-
git bisect start
-
git bisect good
-
git bisect bad
-
-
-
GitHub - Remote ์ ์ฅ์ ํ์ฉํ๊ธฐโ
-
git remote
-
git remote -v
-
git remote add origin ์ฃผ์
-
git remote remove ์ฃผ์
-
-
git clone ์ฃผ์
-
git push
-
git pull
-
git fetch
-
- ์๋๋ฆฌ์ค - Pull request
-
Git๊ณผ Terminal ์ปค์คํ
์ธํ
โ๏ธ
-
git config --global
-