

git init
.git 디렉토리 생성 확인ls -al
git add .
git commit -m "git team init"
git remote add 저장소이름 githubURL처음 연결할 때는 관례적으로 저장소 이름을 origin 으로 사용git remote add origin https://github.com/yachae1101/git-practice.gitgit remote -v
git remote remove 저장소이름git remote remove origin
git push 저장소이름 브랜치이름git push origin main
git branch
git push --set-upstream origin mastergit -M main
git push origin main
git clone https://github.com/yachae1101/git-practice.git
touch new.txtgit add .git commit -m "new.txt 파일 추가" 
git push origin main
에러 발생: 다른 계정의 저장소에는 기본적으로 접근이 안됩니다.

git push origin main
git pull origin main


git log
git reset --hard fb33bd3539e6d1fbe33cb3540684fee9
git pull

git fetch
git log --all --oneline
git diff main origin/main
git merge origin/main
git blame test.txt
특정 commit의 변경 내역을 확인
git blame 커밋해시 파일경로
특정 범위의 변경 내역만 확인
git blame -L 2,3 test.txt
커밋 해시만 표현
git blame -s 파일경로
git blame -s test.txt

Working Directory <-> Staging Area <-> Local Repository <-> Remote Repositorygit stash
git status
save 다음에 저장하는 이름을 설정할 수 있습니다.
-m 다음에 메시지를 추가할 수 있습니다.
git stash save -m "stash massage"
새로운 파일을 하나 추가하고, git stash
untracked 파일은 임시 저장 대상이 아닙니다.
untracked 파일도 임시 저장을 하고자 하는 경우에는 -u 옵션을 이용
git stash -u

git stash list
git pull origin main
git stash apply stash@{인덱스}git stash apply stash@{2}
git stash drop stash@{0}