배워서? 남줘라!
[Github] #3 Basic ‘Git’ commands 본문

1) git 처음 시작할 때
2) 파일 staging과 commit 하기
1) git 처음 시작할 때
| Git commands | Explanation |
| git config –global user.name “KL” | 사용자 정보 입력 |
| git config –global user.email “kyeonglim1695@gmail.com” | 사용자 정보 입력 |
| git init | (새로운 디렉토리 만든 후) 현재 폴더에서 git을 사용하도록 .git이라는 폴더 생성 (ls –la 로 .git 생성 확인) |
| git init yy | yy라는 git repository를 한번에 생성 |
2) 파일 staging 및 commit 하기
| Git commands | Explanation |
| git add xx.txt | xx라는 파일 staging (파일을 Working tree → stage로 이동) |
| git add . | 현재 repository에서 수정된 모든 파일 한꺼번에 staging |
| git commit –m “yy” | yy라는 commit message와 commit |
| git commit –am | staging과 commit 동시에 (한번이라도 commit 된 파일만 가능) |
| git status | 상태 확인. Ex. Untracked files인지, 수정사항을 모두 commit 했으면 “clean” |
| git log | 버전 잘 만들어졌는지 모든 로그 확인 |
| git log –-stat | commit이 어떤 파일들과 관련있는지 보여줌 |
'Github' 카테고리의 다른 글
| [Github] #6 Colab to github (0) | 2022.07.13 |
|---|---|
| [Github] #5 VS Code to github (0) | 2022.07.13 |
| [Github] #4 Local to Remote repository (Push & Pull) (0) | 2022.07.13 |
| [Github] #2 Basic ‘Linux’ commands (0) | 2022.07.13 |
| [Github] #1 Let’s ‘Git’! (0) | 2022.07.13 |
Comments