G Y U L O G

git --help

2020. 2. 15. 23:45

title

 

대충 개념만 알고 vscode로 이전 코드와 현재 코드 비교하는 데 밖에 사용하지 않았던 git을 좀 제대로 알고 사용하고자 한다.

 

iterm설정도 끝냈기 때문에 더 의욕이 샘솟는 기분이다.

 

이번 포스팅의 제목은 git의 명령어에 대한 설명을 알려준다. 

 

https://guides.github.com/activities/hello-world/

 

Hello World · GitHub Guides

The Hello World project is a time-honored tradition in computer programming. It is a simple exercise that gets you started when learning something new. Let’s get started with GitHub! You’ll learn how to: Create and use a repository Start and manage a new b

guides.github.com

위 링크로 가면 github을 통한 gui적인 git 사용법을 알려준다. 

 

어차피 repository 만들 때만 들어갈 것이라서 터미널을 사용해서 git을 공부하려 한다.

 

더 자세한 도움말인 -a, -g 옵션은 나중에 보도록 하자

 

help를 통해 나온 결과를 내가 이해한 대로 써보았다.

 

처음 시작할 때:
   clone     이미 있는 repository를 복제해 새 directory에 넣기
   init       완전 처음부터 만들기

사용할 때:
   add       repository에 파일을 추가
   mv        리눅스의 mv와 동일기능. 이동
   restore  이전 기록을 통한 복구
   rm        리눅스의 rm과 동일기능. 삭제

 

변경 확인:

   bisect    binary검색으로 버그찾기
   diff      commit 기록을 통해 현재와 이전버전의 차이점을 보여줌
   grep      Print lines matching a pattern
   log       commit log를 보여줌
   show      변수타입 보여줌
   status    현재 기록 상태를 보여줌 history?

주 기능:
   branch    List, create, or delete branches
   commit    repository에 변경사항을 기록한다.
   merge     변경기록과 원본을 합쳐버린다.
   rebase    Reapply commits on top of another base tip
   reset     Reset current HEAD to the specified state
   switch    Switch branches
   tag       Create, list, delete or verify a tag object signed with GPG

협업 시:
   fetch     Download objects and refs from another repository
   pull      Fetch from and integrate with another repository or a local branch
   push     수정된 것을 업데이트

 

현재 주로 사용하는 것은 3가지 명령어 입니다.

 

아직 잘 모르기도 하고 더 알아가야죠.

 

$ git clone https://github.com/깃헙아이디/깃헙repository

현재 위치하는 디렉토리에 github 상의 repository를 clone 해 옵니다. 뒤에 원하는 디렉토리를 추가해 그 쪽으로 clone 시킬 수도 있습니다.

 

$ git commit 파일

수정된 것을 commit합니다.

 

이 명령어를 수행할 경우 vim 창이 열리면서 코멘트를 적도록 합니다.

 

$ git push -u origin master

commit한 파일을 push해서 git된 repository로 push합니다.

 

수정본을 업데이트 하는 것이죠. 아직 명령어에 대한 구체적인 의미를 모르기 때문에 이 부분을 먼저 공부해야겠습니다.

 

 

"댓글, 공감 버튼 한 번씩 누르고 가주시면 큰 힘이 됩니다"

 

공유하기

facebook twitter kakaoTalk kakaostory naver band