[Giit] Giit config 작업 설명
기본 작업(자주 사용됨)
git add .
git commit -m "TestCommit"
git push origin HEAD
HEAD
를 지정하면 현재 분기맥OS는 대소문자
head
를 구분하지 않기 때문에push가 다른 OS일 경우 다음과 같은 오류가 발생할 가능성이 있다.error: src refspec head does not match any
error: failed to push some refs to 'https://github.com/XXXXXXXXXXX.git'
git fetch
git pull origin HEAD
git checkout develop
git checkout -b develop
이미 존재하는 경우 오류가 발생합니다.git branch -a
git tag -a v1.0.0 -m 'Tag add.'
git push origin v1.0.0
GitHub인 경우 메르지를 제작한 후Releases
.git show
공통 관계 설정
전제 조건
codecommiit 작업을 수행할 수 있는 권한이 있고 AWS 소개가 설정되어 있음(AWS SSO도 OK)
SSH 버전
~/.ssh/config
에서 다음과 같이 정의Host git-codecommit.*.amazonaws.com
User AXXXXXXXXXXXXX001
git clone ssh://[email protected]/v1/repos/MyDemoRepo my-demo-repo
여러 정의AXXXXXXXXXXXXX001@
가 필요하지 않은 곳은 생략할 수 있다HTTPS 버전
공식적으로는 다음과 같이 예상대로 움직이지 않았기 때문에 개인적 총결산이다.
REPONAME=[1で作成したリポジトリ名]
PROFILE=[AWSプロファイル名]
REGION=$(aws configure get region --profile ${PROFILE})
git init ${REPONAME}
cd ${REPONAME}
git config --local credential.helper "\!aws --profile ${PROFILE} codecommit credential-helper \$@"
git config --local credential.UseHttpPath true
git remote add origin https://git-codecommit.${REGION}.amazonaws.com/v1/repos/${REPONAME}
슈팅
fatal: unable to auto-detect email address
사용자 설정을 하지 않으면 발생
fatal: unable to auto-detect email address
합니다.사용자 설정
git config --global user.name "ユーザー名"
메일 설정git config --global user.email メールアドレス
확인git config -l --global
보충: ~/.gitconfig
에 정보가 추가되었습니다.利用している環境でユーザが統一できていれば問題ないが、
特定のリポジトリは認証情報を変えたいという場合はlocalで設定する必要がある。
git config --local user.name "ユーザー名"
메일 설정git config --local user.email メールアドレス
확인git config -l --local
보충: リポジトリ名/.git/config
에 정보가 추가되었습니다.
Reference
이 문제에 관하여([Giit] Giit config 작업 설명), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://zenn.dev/myabaou/articles/002_git_config텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념 (Collection and Share based on the CC Protocol.)