Git (3)

오랜만에 개인 프로젝트를 시작했는데 쉬는 텀이  길다보니 매번 시작할때마다 git 관련 오류때문에 구글링하는 시간이 아까워 기록용으로 남깁니다.

 

소스 코드 작성하고 이런저런 테스트 해보고 github repo 생성후에 push 하려고 했는데 

% git init

% git remote add origin {github url}

% git push --set-upstream origin main
Password for 'https://aaaaaa@github.com': 
remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/aaaaaa/test.git/'

 

이렇게 에러가 난다면 Password 란에 Personal Access Token(PAT) 값을 넣어주면 됨.

PAT 는 github계정설정 (repo 설정 아님) > Developer Settings > Personal access tokens (classic) 에서 발급받을 수 있음.

 

 

그리고 브랜치 이슈로 아래와 같은 에러가 발생한다면..

 % git checkout main
branch 'main' set up to track 'origin/main'.
Switched to a new branch 'main'
% git merge prod
fatal: refusing to merge unrelated histories

 

% git merge prod --allow-unrelated-histories

이 명령어로 해결할 수 있음

사실 이걸 git 명령어로 확인할 일이 얼마나 있겠냐마는 다음에 혹시라도 또 쓸일이 있을까봐 기록용으로 남깁니다.

 

git shortlog -sne --since="01 Apr 2022" --before="01 May 2022" --no-merges

위 명령어를 이용하면 22년 4월 1일부터 22년 5월 1일 전까지, 즉, 4월 한달동안 merge 커밋을 제외한 실질적인 개발작업의 커밋건수를 확인할 수 있습니다.

결과는 아래와 같이 출력됩니다.

 53  홍길동 <gildong.hong@company.com>
 49  김철수 <cheolsoo.kim@company.com>
 31  임꺽정 <kj.lim@company.com>


 

💻 Programming

[Git] 태그 삭제하기 (removing git tag)

Git에서  태그 삭제하기


git tag -d {name of tag}

git push origin :refs/tags/{name of tag}


git tag -d 12345
git push origin :refs/tags/12345