1. bare 저장소에 .git
폴더 생성
mkdir .git |
2. 모든 파일/폴더를 .git
폴더로 이동
mv branches/ .git/ mv config .git/ mv FETCH_HEAD .git/ mv HEAD .git/ mv hooks/ .git/ mv logs/ .git/ mv objects/ .git/ mv packed-refs .git/ mv refs/ .git/
3. core.bare 설정
git config --local --bool core.bare false |
4. master 브랜치 checkout
git reset --hard |
mkdir .git mv branches/ .git/ mv config .git/ mv FETCH_HEAD .git/ mv HEAD .git/ mv hooks/ .git/ mv logs/ .git/ mv objects/ .git/ mv packed-refs .git/ mv refs/ .git/ git config --local --bool core.bare false git reset --hard |
Git username, password 저장하기
영구 저장 방법
$ git config --global credential.helper store |
임시 저장 방법
$ git config credential.helper cache <timeout> |
To get a commit count for a revision (HEAD
, master
, a commit hash):
$ git rev-list --count <revision> |
예)
$ git rev-list --count branch-1 $ git rev-list --count 3930540717b |
read old new ref author=$(git log -1 $ref --pretty=%an) committer=$(git log -1 $ref --pretty=%cn) echo author:$author echo committer:$committer |
fifty_first_commits = list(repo.iter_commits('master', max_count=50)) assert len(fifty_first_commits) == 50 # this will return commits 21-30 from the commit list as traversed backwards master ten_commits_past_twenty = list(repo.iter_commits('master', max_count=10, skip=20)) assert len(ten_commits_past_twenty) == 10 assert fifty_first_commits[20:30] == ten_commits_past_twenty |