- 현재 연결된 git주소 확인
git remote -v
- 기존 연결을 끊고 새로운 git주소 추가
git remote remove origin
git remote add origin https://gitUrl.git
- 프로젝트 폴더에 깃 생성
git init
- 변경된 모든 소스 추가
git add.
- Commit 하기 (로컬 저장소에 저장)
git commit -m '커밋 메세지'
- Push하기 (원격 저장소에 저장)
git push 원격 저장소명 브랜치 이름
ex) git push origin(원격 저장소 명) main(브랜치 이름)
- Commit 취소
git reset --soft HEAD^
commit된 파일 전부 최소 후 stage된 상태로 working directory에 저장
git reset HEAD~2
가장 최근에 올라간 commit파일 2개만 취소
- Commit된 메세지 수정
git commit --amend -m "수정할 메세지 내용"
- AndroidStudio에 연동된 Github e-mail, name확인 하기
git config user.name
git config user.email
- AndroidStudio에 연동된 Github e-mail, name 변경하기
git config --global credential.username "변경할 이름 입력"
git config --global credential.useremail "변경할 이메일 입력"
'Android개발 > Git' 카테고리의 다른 글
[Android][Git] Git 용어 정리 (0) | 2025.05.30 |
---|