git(feat.github)の使用(TIL 12日目)


「言葉で説明できますか…?」


学ぶときに最初に出会う恐怖は、見慣れない言葉ではないでしょうか.そこで,この論文ではGitを使用する際によく見られる用語や命令について議論する.
ちなみにGitは、スウェーデン籍のフィンランド人プログラマーでLinux創業者のリヌスベンニディクトトワルスが開発した分散バージョン管理システムです.既存のシステムが悪すぎて、2週間以内に直接開発されたという噂があります.気になる方は下記の木のキーホルダーを参考にしてください
https://namu.wiki/w/Git
次の用語表では、英語ですべての用語を作成して、どの用語(コマンド)がどのような場合に使用されるかを決定できます.コマンドを作成する場合は、[]セクションでカッコなしでコンテンツを作成します.
repository : 저장소, 다른 말로 비유하자면 디렉토리(폴더)

fork : 다른 repository의 내용을 나의 repository로 가져오는 것, github 웹페이지에서 진행

clone : 나의 github remote repository 를 local(컴퓨터) repository 로 가져오는 것
명령어 사용법 => git clone [github 주소]

remote : remote repository(온라인)를 연결할 때 사용
명령어 사용법 => git remote add [설정한 별칭] [remote repository 주소] (내 repository의 경우 origin이 별칭 기본값)
명령어 사용법 => git remote -v (연결된 remote repository 확인 시)

status : local repository 에서 수정한 내용들이 현재 어떤 상태인지를(staged/unstaged) 확인하는 것
명령어 사용법 => git status

add : 바꾸거나 수정한 사항들을 commit 하기 위해 staged area 로 올리는 것
명령어 사용법 => git add [file 이름]

commit : staged area에 있는 내용들을 주석과 함께 반영하는 과정, log 명령어를 이용해 commit 기록 확인
명령어 사용법 => git commit
명령어 사용법 => git commit -m ‘[주석처리할 내용]'

log : commit 기록 확인 시 사용
명령어 사용법 => git log

push : 나의 local repository 에 commit 된 내용을 remote repository(github) 으로 업로드하는 것
명령어 사용법 => git push origin [branch 이름]

pull : 협업 시 동료의 remote repository와 연결하여 동료가 자신의 remote repository 에 push 한 내용을 가져오는 것
명령어 사용법 => git pull [설정한 별칭] [branch 이름]

init : 컴퓨터 상의 기존 폴더를 git repository 로 만들 때 사용
명령어 사용법 => git init

restore : unstaged area 의 파일 변경사항을 되돌리거나, staged area 로 add 된 파일을 되돌릴 때 사용
명령어 사용법 => git restore [파일 이름] (unstaged area의 파일)
명령어 사용법 => git restore --staged [파일 이름] (staged area의 파일)

revert : 기존에 작성했던 commit 으로 돌아가 commit 내용을 지우고 새롭게 작성할 때 사용, commit log 는 지워지지 않고 새롭게 추가
명령어 사용법 => git revert [commit ID] (ID는 16진수 숫자로 이루어짐)