Git
터미널에서 Github 사용하기
HBean_
2020. 4. 8. 06:06
<Github 이용 명령어>
1. git 설치
sudo apt-get install git-core
2. github 계정정보등록
sudo git config --global user.name "계정이름"
sudo git config --global user.email "메일주소"
sudo git config --global color.ui "auto"
3. github 저장소 복제
sudo git clone "주소"
4. github 올리기
git init :새로운 git 저장소 생성
git add filename : github에 update 또는 새로 만들 파일 Stage라는 인덱스에 추가
git status
git commit -m "설명"
git log : 변경된 기록 확인하는 명령어
git remote add origin 원격서버주소
git push origin master
*특정 branch clone
git clone -b 브랜치명 --single-branch 저장소url 디렉토리명
디렉토리를 지정하고 싶으면 적기, 따로 명시하지 않으면 레파지토리 이름으로 디렉토리 생성됨.
*기타*
- 디렉토리 생성 : mkdir (directoryname)
- 디렉토리 삭제 : rm -rf (directoryname) : 내부 파일 및 디렉토리 전체 삭제