기타/Git

GIT_github

서울소시민 2017. 8. 19. 18:54


원격저장소 만들기


 $ git remote add origin https://github.com/egoing2/gidkei....

Local origin이라는 이름의 저장소를 만들어서 저장한다.

 

$ git remote

저장소 리스트 보기

 

$ git remote v

리스트 자세히 보기

 

$ git remote add friend https://github.com/egoing2/gidkei....

Friend 라는 이름으로 로컬 저장소 만들기

 

$ giit remote remove friend

Friend 저장소 제거하기

로컬저장소에서 원격저장소로 보낼 때

'push' 한다.

 

$ git push u origin master

$ git push 만 해줘도 됨



 

 

원격저장소 -> 지역저장소

 

$ git clone https://github.kdfjiejf(github URL) git_home

$ git clone https://github.kdfjiejf(github URL) git_office


$ git commit -amed

원격 저장소 올리기 전 commit메세지 바꾸기

push한 이후 내용은 수정 하지 말자(?)

  

$ git pull (fetch + merge)

 

원격저장소에서 로컬저장소로 가져온다

branch push하려면 어떻게??

git checkout <branch name>

git push

 

ssh 사용하기 

ssh key를 이용한 비밀번호 입력하지 않고 원격 저장소 접속하기


$ ssh-keygen

$ cd ~/.ssh

$ cat id_rsa.pub




 New SSH key

 

$ git clone git@github.com:jhoon07/git_test_ssh.git git_test

$ cd git_test

 

$ git init

$ vim f1.txt

$ git add f1.txt

$ git commit –m hello~

$ git push

 

 



'기타 > Git' 카테고리의 다른 글

git push 방법  (0) 2017.11.05
git 사용법  (0) 2017.10.23
GIT_branch  (0) 2017.08.19
GIT_commit, reset, revert  (0) 2017.08.19