Github/Git Starter Guide for Introductory Level Curtis Kim @ KAKAO
Why Github/Git?
- :, - - Q1 :? - Q2 :? - Q3 : ( )? - Q4 :? - Github/Git. Old Paradigm : - - a.java.. Git.
- - - - - - - - - (commit & push) (pull request). - (committer) merge pull. - -, - push. - -
,? - -, - -!! - - ( ) :,, - :
Github Git Git SourceTree & CLI
Git. Checkout :. Pull : ( ). Commit : Push : (Commit).
Git (, ). Merge : 1, 2 Rebase : 1, 2
Git. - Clone. - Pull. - Checkout. - Commit - Push - -, QA, - Merge - ( ) SourceTree. - https://www.sourcetreeapp.com/ - github Repository!
Github Repository. Github Create new Repository. public private. Initialize this repository with a README -... Add.ignore - Python -
Clone : (github) $ git clone git@github.com:ildoonet/githubpractice.git
Log :, 2 (+). $ git log commit 7c138fd071448c71ee260bf474920eff262caa5b Author: Ildoo Kim <ildoo@ildoo.net> Date: Thu Feb 9 13:34:45 2017 +0900 $ Initial commit
Pull : SourceTree CLI $ git pull Already up-to-date. * git pull help.
Branch & Checkout : SourceTree CLI $ git branch * master $ git branch feat-1-default_webserver $ git branch feat-1-default_webserver * master $ git checkout feat-1-default_webserver Switched to branch feat-1-default_web_server' $ git branch * feat-1-default_webserver master * - - * ex) feat-2333-web_server * ex) bug-3521-no_log_in_textfile * * * checkout
test.py Commit. SourceTree CLI $ git ls-files others # untracked file list test.py $ git add test.py $ git commit -m add test.py file. [feat-1-default_webserver 66f41a5] add test.py file. 1 file changed, 2 insertions(+) create mode 100644 test.py * Commit : * Commit,. (push ) * *,,.
test.py Commit. feat-1-default_web_server,. Commit (Push ) Github.
Push Push Push $ git push --set-upstream origin feat-1-default_web_server Counting objects: 3, done. Delta compression using up to 8 threads. Compressing objects: 100% (2/2), done. Writing objects: 100% (3/3), 350 bytes 0 bytes/s, done. Total 3 (delta 0), reused 0 (delta 0) To github.com:ildoonet/github-practice.git * [new branch] feat-1-default_web_server -> feat-1- default_web_server Branch feat-1-default_web_server set up to track remote branch feat-1-default_web_server from origin.
Merge (master) 1 / 3 - github pull request merge - pull request - pull request. 2 / 3 $ git checkout master $ git merge feat-1-default_web_server Updating 7c138fd..66f41a5 Fast-forward test.py 2 ++ 1 file changed, 2 insertions(+) create mode 100644 test.py 3 / 3
Git. - Clone. - Pull. - Checkout. - Commit - Push - -, QA, - Merge - ( )
Commit Conflict
Commit -.. -. -. -. -. -. -. -,. -.
Conflict Commit, Merge Conflict. Conflict 2, <<<<<<< HEAD This is test file. ======= This is a test file. >>>>>>> HEAD ( ) Conflict. << >> Commit. * SourceTree Conflict 2.
3 : Reset / Revert / Stash 3 Reset -. - Stash - stash. - stash reset,. Revert - -.
3 : Merge / Rebase / Cherry-pick Merge - Rebase -. Cherry-pick -.
2 : Blame, Bisect Blame -, Bisect - -
Git (1/2)
Git (2/2)
(ebook) Git GitHub : http://codedragon.tistory.com/4 GitHub : https://github.com/mixed/github-usecase, GitHub : https://realm.io/kr/news/codereview-howto/ Github Gist : https://gist.github.com/msjang/e30f71fc6cdfd0d27e3c
: : TDD - -, - - QA, - (1), (2), (3) side-effect, (4). - : Docker, Vagrant - : Chef, Puppet, Ansible - -. - :. - :. -.
Github/Git Starter Guide for Introductory Level Curtis Kim @ KAKAO