-
Notifications
You must be signed in to change notification settings - Fork 6
git
์ด๊ณณ์ผ๋ก ์ค๋ ์ฃผ์ โจ http://bit.ly/git-offline
- git : https://git-scm.com/ (git ์ค์น ํ๋ก๊ทธ๋จ, ๊น์ด ์ค์น๋๋ ๊ฒฝ๋ก๋ฅผ ๋ณ๊ฒฝํ์ง ๋ง์์ฃผ์ธ์)
- vscode : https://code.visualstudio.com/ (์ฝ๋ ์๋ํฐ ํ๋ก๊ทธ๋จ, ํฌํฐ๋ธ ๋ฒ์ ์ ์ฌ์ฉํ์ง ๋ง์์ฃผ์ธ์)
- snipaste : https://www.snipaste.com/ (์คํฌ๋ฆฐ์บก์ฒ ํ๋ก๊ทธ๋จ. ์ ํ์ฌํญ)
- sourcetree : https://www.sourcetreeapp.com/ ์ค์นํ ๋ Registration ํญ๋ชฉ์์ bitbucket server ๋ง๊ณ bitbucket์ ์ ํํด์ฃผ์ธ์. bitbucket์ ํ์๊ฐ์ ์ ํด์ผ ์ค์นํ ์ ์์ต๋๋ค. ์ธํฐ๋ท ์ต์คํ๋ก์ด์ ๊ฐ์ด ์ค๋๋ ๋ธ๋ผ์ฐ์ ์์๋ ์ค์น๊ฐ ์๋๋ ๊ฒฝ์ฐ๊ฐ ์์ต๋๋ค.ํฌ๋กฌ์ ์ด์ฉํด์ฃผ์ธ์. (๊น ํด๋ผ์ด์ธํธ. ๊ฐ์ฌ๊ฐ ์ค์น๋ฅผ ์์ฒญํ ๋ ์ค์นํด์ฃผ์ธ์.)
http://kdiff3.sourceforge.net/ (๋น๊ต ํ๋ก๊ทธ๋จ. ๊ฐ์ฌ๊ฐ ์ค์น๋ฅผ ์์ฒญํ ๋ ์ค์นํด์ฃผ์ธ์.)
git config --global --add merge.tool kdiff3
git config --global --add mergetool.kdiff3.path "C:/Program Files/KDiff3/kdiff3.exe"
git config --global --add mergetool.kdiff3.trustExitCode false
git config --global --add diff.guitool kdiff3
git config --global --add difftool.kdiff3.path "C:/Program Files/KDiff3/kdiff3.exe"
git config --global --add difftool.kdiff3.trustExitCode false
git config --add merge.tool kdiff3
git config --add mergetool.kdiff3.path /Applications/kdiff3.app/Contents/MacOS/kdiff3
git config --add mergetool.kdiff3.trustExitCode false
git config --add diff.guitool kdiff3
git config --add difftool.kdiff3.path /Applications/kdiff3.app/Contents/MacOS/kdiff3
git config --add difftool.kdiff3.trustExitCode false
git config --global diff.tool p4merge
git config --global difftool.p4merge.path 'C:\Program Files\Perforce\p4merge.exe'
git config --global merge.tool p4merge
git config --global mergetool.p4merge.path 'C:\Program Files\Perforce\p4merge.exe'
ํ๊ธ์ด ๊นจ์ง๋ ๊ฒฝ์ฐ : Configure > Regional Settings > File Encoding for A > "UTF-8 BOM" ์ผ๋ก ๋ณ๊ฒฝ
- git commit ๋ช ๋ น์ ์ ๋ ฅํ์ ๋ ์๋์ ๊ฐ์ ์ค๋ฅ๊ฐ ๋์จ๋ค๋ฉด
*** Please tell me who you are.
Run
git config --global user.email "you@example.com"
git config --global user.name "Your Name"
to set your account's default identity.
Omit --global to set the identity only in this repository.
fatal: unable to auto-detect email address
์๋์ ๊ฐ์ด ์์ ์ ์ด๋ฆ๊ณผ ์ด๋ฉ์ผ์ git์๊ฒ ์๋ ค์ฃผ์๋ฉด ๋ฉ๋๋ค. ๋ฒ์ ์ ์์ฑํ ๋ ์๋์ผ๋ก ์ฌ์ฉํ ์ด๋ฆ๊ณผ ์ด๋ฉ์ผ์ ์ค์ ํ๋ ํ๋ฉด์ ๋๋ค.
$ git config --global user.name "John Doe"
$ git config --global user.email johndoe@example.com
- https://docs.google.com/spreadsheets/d/19YyV5CqNCZDzrkJI6H0FNhkR4AOwh-r0CcwSZBP1hhM/edit?usp=sharing
- git ์จ๋ผ์ธ ๊ฐ์ ์ ๊ตฌ : https://opentutorials.org/module/3733
- ์ง์์ง๋ : https://seomal.org
- gerrit : https://www.youtube.com/watch?v=Jv3ggQw7Eio
https://www.atlassian.com/git/tutorials/atlassian-git-cheatsheet
git config --global core.editor "code --wait"
git config --global core.editor "nano"
- ํ๋ก์ ํธ ํด๋๋ฅผ ๋ง๋ ๋ค.
- ํด๋๋ฅผ ์ ์ฅ์๋ก ์ง์ ํ๋ค. (git init)
- ํ์ผ์ ์์ ํ๋ค.
- ์ปค๋ฐ์ ํฌํจ์ํค๊ณ ์ถ์ ํ์ผ์ ์คํ ์ด์ง๋ก ๋ฑ๋กํ๋ค. (git add)
- ์ปค๋ฐํ๋ค. (git commit)
- ์๊ฐ ์ฌํ์ ํด๋ณธ๋ค (HEAD๋ฅผ ์ฎ๊ธด๋ค. => git checkout)
- ์๊ฐ ์ฌํ์ ๋๋ธ๋ค. (git checkout master)
- ๋ฒ์ ์ ์ทจ์ํ๋ค. (master๋ฅผ ์ฎ๊ธด๋ค. => git reset --hard )
- ๋ฒ์ ์ ๋ณต๊ตฌํ๋ค. (์์ ๋ด์ญ์ ์กฐํํ๋ค. => git reflog)
- ์คํ์ ์ธ ์์ ์ ์์ํ๊ธฐ ์ํด์ ๋ธ๋์น๋ฅผ ๋ง๋ ๋ค(git branch exp)
- ์คํ์ ์ธ ์์ ๋ธ๋์น์์ ์ปค๋ฐํ๋ค. (git checkout exp)
- ๋ง์คํฐ์์ ์์ ์ ํ๋ค. (git checkout master)
- ๋ง์คํฐ๋ก ์คํ์ ๋ณํฉํ๋ค. (git checkout master && git merge exp)
- ์ถฉ๋ ์ํฉ์ ๋ง๋ค์ด ๋ณธ๋ค. (3 way merge์ ๊ฐ๋ ์ ํ์ฉํ๋ค)
- ์๊ฒฉ ์ ์ฅ์๋ฅผ ๋ง๋ ๋ค. (github.com, gitlab.com)
- ์ง์ญ ์ ์ฅ์์ ์๊ฒฉ ์ ์ฅ์๋ฅผ ์ฐ๊ฒฐํ๋ค. (git remote add origin ์๊ฒฉ ์ ์ฅ์์ ์ฃผ์)
- ์ง์ญ ์ ์ฅ์์ ๋น๋ฐ๋ฒํธ๋ฅผ ์๊ฒฉ ์ ์ฅ์์ ๋ฑ๋กํ๋ค. (ssh-keygen, id_rsa.pub ํ์ผ์ github์ ๊ณ์ ์ ssh ํค๋ก ๋ฑ๋กํ๋ค)
- ์ง์ญ ์ ์ฅ์์ ๋ธ๋์น์ ์๊ฒฉ ์ ์ฅ์์ ๋ธ๋์น๋ฅผ ์ฐ๊ฒฐํ๋ค. (git push -u origin master)
- ๋๋ฃ๋ฅผ ์ถ๊ฐํ๋ค. (github์ setting์ collaborators์ ๋๋ฃ์ ๊ณ์ ์ ์ถ๊ฐํ๋ค)
- ์ถฉ๋ ์ํฉ์ ๋ง๋ค์ด๋ณธ๋ค.
for i in {a..f} ; do echo $i > $i.txt; git add $i.txt; git commit -m "$i"; done;
for i in {a..f} ; do echo $i > foo.txt; git add foo.txt; git commit -m "$i"; done;
https://www.icloud.com/keynote/0L29YPsBkbTRSfiPWtT1rl6fg#keynote_2
git checkout master;
echo "1
-
-
2
-
-
3
-
-
4" > work.txt;
git add work.txt;
git commit -am "start";
git branch -D left;
git checkout -b left
echo "1
-
-
L2
-
-
3
-
-
4" > work.txt
git commit -am "L2";
echo "1
-
-
L2
-
-
3
-
-
L4" > work.txt
git commit -am "L4";
git checkout master;
git branch -D right;
git checkout -b right;
echo "1
-
-
2
-
-
R3
-
-
4" > work.txt;
git commit -am "R3";
echo "1
-
-
2
-
-
R3
-
-
R4" > work.txt;
git commit -am "R4";
echo "1
-
-
2
-
-
R3
-
-
R45" > work.txt;
git commit -am "R5";
git checkout right;
git rebase left;
git checkout left;
git merge right;
git init;
echo "1\n\n2\n\n3\n\n4" > revert.txt;
git add revert.txt;
git commit -m "init";
echo "m1\n\n2\n\n3\n\n4" > revert.txt;
git commit -am "m1";
echo "m1\n\nm2\n\n3\n\n4" > revert.txt;
git commit -am "m2";
echo "m1\n\nm2\n\nm3\n\n4" > revert.txt;
git commit -am "m3";
echo "m1\n\nm2\n\nm3\n\nm4" > revert.txt;
git commit -am "m4";
git revert HEAD@{2}
git init;
echo "" > revert.txt;
git add revert.txt;
git commit -m "init";
echo "1" > revert.txt;
git commit -am "1";
echo "2" > revert.txt;
git commit -am "2";
echo "3" > revert.txt;
git commit -am "3";
echo "4" > revert.txt;
git commit -am "4";
git revert HEAD@{2};
# 1 - 2 - 4
https://github.com/egoingsb/git-linear-binary-compare.git
echo "1 linearsearch unhappy bug" >> foo.txt ; git add foo.txt; git commit -m 1;
for i in {2..100} ; do echo $i >> foo.txt; git add foo.txt; git commit -m "$i"; done;
echo "101 binary search happy bug" >> foo.txt ; git add foo.txt; git commit -m 101;
for i in {102..125} ; do echo $i >> foo.txt; git add foo.txt; git commit -m "$i"; done;
echo "126 binary search unhappy bug" >> foo.txt ; git add foo.txt; git commit -m 126;
for i in {127..199} ; do echo $i >> foo.txt; git add foo.txt; git commit -m "$i"; done;
echo "200 linear search happy bug" >> foo.txt ; git add foo.txt; git commit -m 200;