바라보고 있는 저장소 확인: git remote -v
저장소 복사: git clone URL
추가: git add test.py
커밋: git commit -m "메모"
푸시: git push
푸시하기전에 어떤 branch인지 확인하자
mater branch에 푸시하면 바로 merge된다.
작업한 내용은 branch 하나 파서 하자
브랜치 생성: git branch <생성할 브랜치 명>
브랜치 확인: git branch
브랜치 전환: git checkout <branch>
*브랜치 생성 및 전환: git checkout -b <branch>
원격 저장소의 브랜치에 푸시: git push origin <branch>
- 여기서 origin은 원격 저장소(remote)의 주소를 뜻한다.
merge 이후 액션
최신 코드가져오기: git pull
로그 확인하기: git log
- 마지막 커밋 로그랑 비교해보기
20210728 추가
git push했을 때, remote: Repository not found라는 에러가 뜨는 경우가 있다. 구글링해보니 아래와 같은 대체 방법이 있었다.
| 1. git clone https://kevin.fit@github.daumkakao.com/toros/analysis.batch 2. mac에서 keychain access.app에서 github.daumkakao.com 제거 후 다시 push 3. git remote set-url로 재설정 |
그래도 안된다면 해당 repository에 권한이 있는지 체크해보자