git 사용자 이름 비밀번호 설정 예시 코드

git 사용자 이름 비밀번호 설정
git 사용자 이름/메 일 박스 설정

git config --global user.name [username]
git config --global user.email [email]
그러나 이것 은 사용자 이름 비밀 번 호 를 설정 하 는 것 일 뿐 입 니 다.git 원본 이 작업 할 때마다 사용자 이름/비밀번호 인증 을 입력 해 야 한다 면 매번 설정 이 필요 합 니 다.어떻게 해 야 합 니까?
git 사용자 이름 비밀번호 저장
여 기 는 주로 config 항목 을 설정 합 니 다.
두 가지 방법 이 있 습 니 다.기본적으로 원 리 는 모두 같 습 니 다.git/config 파일 을 수정 하 는 것 입 니 다.
1.다음 명령 을 사용 하여 config 파일 을 수정 하면 저장 할 수 있 습 니 다.

echo "[credential]" >> .git/config
echo "  helper = store" >> .git/config
2.git/config 파일 직접 수정
linux/mac 에서 vim 도 구 를 사용 하여 config 파일 을 직접 수정 할 수 있 습 니 다.

ubuntu@VM-7-212-ubuntu:~/kernel-code/kernel-netfilter-sample-code$ vim .git/config

##     

[core]
  repositoryformatversion = 0
  filemode = true
  bare = false
  logallrefupdates = true
[remote "origin"]
  url = https://github.com/Miss-you/kernel-netfilter-sample-code.git
  fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
  remote = origin
  merge = refs/heads/master
##        ,      ,     
[credential]
  helper = store

##  
이렇게 하면 사용자 이름 비밀 번 호 를 저장 할 수 있 습 니 다.매번 입력 할 필요 가 없습니다!
git config 설정 보기
git config--list 를 사용 하여 설 정 된 설정 보기

feiqianyousadeMacBook-Pro:xt_GTPU yousa$ git config --list
core.excludesfile=/Users/yousa/.gitignore_global
user.name=Miss-you
[email protected]
core.repositoryformatversion=0
core.filemode=true
core.bare=false
core.logallrefupdates=true
core.ignorecase=true
core.precomposeunicode=true
remote.origin.url=https://github.com/Miss-you/xt_GTPU.git
remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
branch.master.remote=origin
branch.master.merge=refs/heads/master
git 가 사용자 이름 비밀 번 호 를 설정 하 는 예제 코드 에 관 한 이 글 은 여기까지 소개 되 었 습 니 다.더 많은 git 사용자 이름 비밀번호 내용 은 예전 의 글 을 검색 하거나 아래 의 관련 글 을 계속 찾 아 보 세 요.앞으로 많은 지원 바 랍 니 다!

좋은 웹페이지 즐겨찾기