반응형
설치 및 환경 설정
- http://git-scm.com/download/win
- git config --global user.name user_exam → github 사용자명 설정
- git config --global user.email user_exam@example.com → github 이메일 설정
- git config --list → 설정 확인
- mkdir github_folder && cd github_folder → github 프로젝트 저장 폴더 생성
- git clone "https://github.com/my_user/project_name" → github 원격 저장소 동기화
폴더 생성
- git init → 깃 활성화
- git remote add origin "https://github.com/my_user/project_name" → 자신의 깃허브 원격 저장소 위치
- git add 폴더명 # 취소 → git reset HEAD
- git status → 폴더 안에 올라갈 파일 확인 (git diff를 사용하여 원격 저장소와의 차이점 확인 가능)
- git commit -m "메세지 내용" → 정보 기록
- git push -u origin master
- git push → 이미 원격 저장소에 내용이 있어 push가 안되는 경우 git pull을 사용하여 내용 업데이트 후 git push
- 원격 저장소와 로컬 저장소에 있는 파일 혹은 폴더 삭제
- git rm -rf "example.java"
- git commit -m "remove example.java"
- git push
실행 권한 부여
- sh 등과 같은 실행 파일 업로드 시 실행 권한 누락 해결
- git add test.sh
- git status
- git ls-tree HEAD # 파일 권한 확인
- git update-index --chmod=+x *.sh
- git push -f
원격저장소에서 특정 디렉터리만 clone
- git init
- git remote add -f origin "git 레포지토리명"
- git config core.sparseCheckout true
- echo "youwant/directory_name" > .git/info/sparse-checkout
- git pull origin master
반응형
'OS-서버' 카테고리의 다른 글
칼리리눅스 IP 수동 설정 (0) | 2021.08.09 |
---|---|
Synology nas 기본 환경 설정 (2) | 2021.06.12 |
Sophos UTM 설치 및 환경 구성 (0) | 2020.10.13 |
VMware에 안드로이드 설치하기 (0) | 2020.10.05 |
리눅스 DNS 서버 구축하기 (0) | 2020.05.01 |