雑草SEの備忘録

東大を卒業し、SEとして働くことになった。備忘録的に作業を綴る。

gitのcommitのハッシュ値からmerge commitを取得する

 1. pipでgit-get-mergeをinstall(事前にpythonのインストールが必要)

pip install git-get-merge

 2. commitのHash値で調査

git get-merge <Hash値>

 3. ベースのブランチ名はmasterだが、変更したい場合は

git get-merge <Hash値> <branch名>
# eg)
git get-merge <Hash値> develop

 GitHubのREADMEをよく読む。

pythonのpathが通ってないがpython3のpathは通っている場合

  • macのpythonを使っている場合など。
$ python3 -V
Python 3.9.6

$ which python3
/usr/bin/python3
$ python3 -m pip install git-get-merge
$ python3 -m pip show -f git-get-merge
~略~
Files:
  ../../../../../Caches/com.apple.python/Users/hogehoge/Library/Python/3.9/lib/python/site-packages/get_merge/__init__.cpython-39.pyc
  ../../../bin/git-get-merge
  get_merge/__init__.py
  git_get_merge-0.3.dist-info/INSTALLER
~略~

.zshrcなどに以下を追加(Library/Python/3.9/binの箇所は、上記コマンドを確認の上指定。

export PATH=$PATH:$HOME/Library/Python/3.9/bin