명령어를 기본으로 한 명령어 프로그램
Git 공식 홈페이지
- GUI tools
- Sourcetree
- GitKraken
- etc
- Terminal
- macOS - iTerm2
- windows - cmder
git --version
git config --list // 모든 설정 확인 가능 git config --global -e // config 파일 edit
Open VScode > command palette > >code > Shell command Install'code' command in PATH
git config --global core.editor "code" git config --global -e code . git config --global core.editor "code --wait" // wait 옵션 주었기에 VScode 로 열린 파일 종료되기 전까지 다른 명령어 수행 불가능
- 사용자 환경 설정
git config --global user.name "username" git config --global user.email "useremail" git config user.name git config user.email
macOS
- Line feed ('\n')하나만 들어감
windows
- Carriage return('\r') & Line feed ('\n')동시에 들어감
macOS이면 input, windows면 true
git config --global core.autocrlf input
- 반복해서 자주 쓰는 명령어를 간단하게 치고 싶다면
git config --global alias.st status
- status -> st 로 간편하게 바꿔 사용 가능
- 만약 oh-my-zsh 를 설치했다면 gst 만 쳐도 git status 랑 동일하게 동작!
git add *.txt
// *: 디렉토리의 모든 파일 의미
// txt 파일 전체 Staged
- log 파일들 모두 깃헙에 안 올리고 싶어! 라면 gitignore 에다가 전부 넣어버리기
echo *.log > .gitignore
- If, 특정 폴더 안에 log 파일들을 보고 싶지 않다면
echo build/*.log > .gitignore
- short 간단하게 보여줌
- A b.txt
- b.txt add, 현재 Staging area
- M c.txt
- c.txt add, 현재 Modified
- ?? .gitignore
- 현재 Untracked, Working directory
- Staging area 에 있는 것을 확인하고 싶을 때
git diff --staged
- 누가 작성했는지, 언제, 타이틀, description
git log
// 삭제한 파일, 폴더를 반영하고 싶을 때
git add -u
git commit -a -m "Delete"
git push af main