[리드미 파일 생성]

echo "# <Title>" >> README.md

 

[깃 이그노어 파일 생성]

echo "/<ignore_directory_name>" >> .gitignore

 

[깃 초기 세팅, .git 폴더 생성]

git init

 

[계정 설정]

git config --global user.name "updaun"
git config --global user.email "updauney@daum.net"

 

[레파지토리 설정]

git remote add origin https://github.com/updaun/FaceRecognition_Rpi.git

 

[설정 확인]

git config --list

 

[현재 디렉토리에서 .gitignore에 명시한 파일을 제외한 모든 파일을 Staging area로 이동]

git add .

[커밋]

git commit -m "first commit"

 

[커밋 상태 확인]

git status -u

 

[브랜치 설정]

git branch -M master

 

[브랜치 확인]

git branch

 

[브랜치 변경]

git checkout master
git checkout <branch_name>

 

[푸시]

git push -u origin master

 

[브랜치로 푸시]

git push -u origin <branch name>

 

2021.06.22 내용 추가

* 비밀번호를 한 번 입력하면 그 뒤로는 입력 없이 Push

 

* 새로운 컴퓨터에서 push를 시도하다 에러 발생

- git bash를 관리자 권한으로 실행한 뒤 해당 명령어 입력 후 push를 시도해보자

[ auth reset ]

git config --system --unset credential.helper

[ auto auth ]

git config --global credential.helper store

* 설정 후 한 번 정도는 로그인 해야할 수 있음

 

2022.02.22 내용 추가

[add 취소]

git reset

 

[commit 취소]

git reset --hard HEAD~1

 

[강제 push]

git push origin master --force

 

2022.06.29 내용 추가

[commit 메세지 수정]

git commit --amend -m "[docs] update readme" -m "add images and link embedding"

[commit 날짜 변경]

git commit --amend --no-edit --date "Tue Jun 28 2022 23:59:15 GMT+0900"

 

'SW > git' 카테고리의 다른 글

[git]Logon failed, use ctrl+c to cancel basic credential prompt  (1) 2021.04.12

+ Recent posts