github 사용법 - arcturus9/useful-link GitHub Wiki
.. git clone을 private repo를 위해 personal token이용 https://tmjb.tistory.com/83
.. 일단 git을 시작
git init
.. remote 접속
git remote add origin https://github.com/username/myproject.git
.. origin 조회 및 변경 git remote -v git remote set-url origin https://github.com/username/myproject.git
.. clone하기
git clone https://github.com/username/NameRepo.git NameLocalFolder
< [비전공생을 위한 git, github 개념과 사용법 설명] 57분짜리 설명 영상 >
https://www.youtube.com/watch?v=JEY3X64gX4Q
-
git ssh 설정 http://ourcstory.tistory.com/112
-
git clone : [remote repository] <--> [local repository]
git clone [email protected]:xxxxid/NameRepo.git NameLocalFolder
cd NameLocalFolder git log
- Branch
git brunch : 각자작업
git merge : 추후 합치기
git status
:"Untracked file" - 타임캡슐 정보 없음
git add test.py
: 묻으려는 파일 생성
git commit -m "created test.py"
git status
git log
(아직 동기화는 안되어있음)
git push origin(repository경로.git을 의미한다) master
: origin이라는 경로에 master(local에서)에서 작업한거를 올린다.
git branch git branch function git branch git checkout function
: function branch로 갈아탄다는 의미
git branch
(test.py 수정작업한다)
git log
python test.py
git status
git add test.py
git commit -m "function was created"
git push origin function
: function branch sync completed!
==> 완성 했으면 보고서 올리고, master에 반영해달라고 요청 : [pull request] --> 일종의 보고서로 보면됨
BOLD
'''python
print "foo"
'''
-1
-2
111
222
333
merge는 누구나 누를 수 있지만, reviewer가 확인 끝나고 함 (by 책임자)
--> merge를 누르면 master 업데이트 완료!!
git status
git checkout master
(remoter repository에는 반영 되었지만, local에는 아직 반영안됨)
git fetch
git fetch -all (remote내용을 local에 업데이트 한다)
git log
git reset --hard origin/master
(reset은 위험한 명령어중에 하나임, remote내용을 그대로 다 가져온다는 의미)
git branch A git checkout A git status
(test.py작업후)
git add test.py
git commit -m "msg is A"
git push origin A
git log git checkout master
git branch B
git checkout B
git log
git status
git add test.py
git commit -m "msg is B" git push origin B
git status
git log
==> conplict가 발생하면, 겹치는 부분을 해결해야 한다. ex "msg is C"
git log git fetch -all
git reset --hard origin/master