study
git 명령어 간단 정리
intseq
2021. 12. 30. 20:35
git 명령어 간단 정리
git 서버에서 저장소 생성
# git init --bare /home/gitrepo/testrepo
클라이언트에서 git 사용자 설정
# git config --global user.email "gituser@example.com"
# git config --global user.name "Git Tester"
로컬 저장소 생성
# git init
git 파일 추가
# git add /path/to/filename
로컬 저장소로 commit
# git commit -m “First Commit”
리모트 저장소 추가
# git remote add origin ssh://gituser@example.com:/home/gitrepo/testrepo
리모트 저장소 보기
# git remote -v
로컬 저장소 파일을 리모트로 commit (origin 은 저장소, master 는 브랜치)
# git push origin master
리모트 저장소 clone
# git clone ssh://gituser@example.com:/home/gitrepo/testrepo
변경된 파일 목록등이 현재 git 상태를 볼려면
# git status