git init // 현재 디렉토리를 로컬저장소로 설정한다.
git status // 로컬저장소의 현재 상태를 보여준다.
// git commit에 사용될 username
git config --global user.name "your_name"
// git commit에 사용될 email
git config --global user.email "your_email@example.com"
// Github 원격저장소와 연결한다.
git remote add origin [자신의 Github 원격저장소 주소]
// a.html 파일만 추가
git add a.html
// 워킹 디렉터리 내 모든 파일을 추가
git add .
// 워킹 디렉터리 내 폴더 추가
git add 폴더명/
// 명령 프롬프트에서 상호작용하면서 추가 (나갈땐 q를 입력)
git add -i
// 진행중인 파일일 경우, Staging Area에서 워킹 디렉터리로 옮겨온다.
$git rm --cached a.html
$git rm -r --cached .
1-1. git rm -rf {파일 및 폴더명} // 모두 삭제
1-2. git rm -r --cached {파일 및 폴더명} // 원격 저장소에 있는것만 삭제
2. git commit -m "commit 내용"
3. git push -u origin master
// 간단한 커밋 메시지를 입력후 커밋
git commit -m "커밋 메시지"
// 커밋 이력 상세조회
git log
git push origin master
git pull origin master 하면 origin의 내용이 master로 복사됩니다.
git config --unset credential.helper
// 아이디 패스워드 초기화
'Github사용법' 카테고리의 다른 글
intellij Git clone 과 Gitlab server 연결하는 법 (0) | 2022.07.19 |
---|---|
Git 에러 Non fast forward 와 fetch first (0) | 2022.03.17 |
Git 사용 (0) | 2022.02.22 |
git _revoke (0) | 2022.02.07 |
Git -remote (0) | 2022.02.07 |