페이지 트리

이 페이지의 이전 버전을 보고 있습니다. 현재 버전 보기.

현재와 비교 페이지 이력 보기

« 이전 버전 5 현재 »

Git username, password 저장하기

영구 저장 방법

  • ~/.git-credentials 파일에 plain text로 저장됨 (파일에 대해 access 권한 관리 필요)
$ git config --global credential.helper store 

임시 저장 방법

  • 캐시에 임시 저장됨
$ git config credential.helper cache <timeout>


Commit 개수 얻기

To get a commit count for a revision (HEADmaster, a commit hash):

$ git rev-list --count <revision>

예)

$ git rev-list --count branch-1
$ git rev-list --count 3930540717b

How to authenticate user via git pre-receive hook

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


  • 레이블 없음