Source Tree같은 Tool을 사용할 수 있지만, 상황에 따라서 git bash를 통하여 작업해야 할 경우가 있다.
다음 경우에 사용할 수 있는 방법을 알아두면 편리하다.
이전에는 아이디와 비밀번호로 사용가능했으나, 현재는 사용할 수 없기 때문에 Token 생성부터 진행해야하며,
생성 방법은 다음과 같다.
git bash 이용방법
1. token 생성
- profile -> settings -> developer settings -> personal access tokens -> tokens(classic) 등록
- note(용도), select scopes(권한) 세팅 후 -> generate token 선택
- bash or tool에서 password 입력 필요 시 입력
2. commit
- 해당 폴더 이동
- ls -al
- git status
- add : git add 파일명 or git add .(전체)
- cancel : git reset 파일명 or git reset(전체)
- commit : git commit 후 메시지 작성(git commit -m "메시지" 로 대체 가능
- commit cancel : git log -> git reset --soft a32323(commit 코드)
- push : git push -u origin main