間違いだらけの備忘録

このページの内容は無保証でありこのページの内容によって直接、または間接に損害を受けられたとしても私は責任を取りません。

rebase中の情報

適用を試みたcommitのID

.git/rebase-merge/stopped-sha

適用を試みたpatch

.git/rebase-merge/patch

めも

git reset --hard && git clean -xfd && \
patch -p1 -l --binary < .git/rebase-merge/patch ; \
git status ; cat .git/rebase-merge/message

パッチ内容の確認
http://d.hatena.ne.jp/gunshot/20140110/p1

diff-highlight < .git/rebase-merge/patch | less -R
diff-highlight < file/path
diff -u <(git cat-file -p `cat .git/rebase-merge/stopped-sha`~1:path/file) \
path/file |diff-highlight | less -R


以前のcommitメッセージを流用

git commit -a -C `cat .git/rebase-merge/stopped-sha` && git rebase --skip

ex.適用を試みたpatchからファイルを持ってくる

 H=`cat .git/rebase-merge/stopped-sha`; \
N=`git show --pretty="format:" --name-only $H`; \
git checkout $H $N

以下古い記述
======

適用を試みたcommitのID

.git/rebase-apply/original-commit

適用を試みたpatch

.git/rebase-apply/patch

めも

git reset --hard && git clean -xfd && \
patch -p1 -l --binary < .git/rebase-apply/patch ; \
git status ; cat .git/rebase-apply/msg-clean

パッチ内容の確認
http://d.hatena.ne.jp/gunshot/20140110/p1

diff-highlight < .git/rebase-apply/patch | less -R
diff-highlight < file/path
diff -u <(git cat-file -p `cat .git/rebase-apply/original-commit`~1:path/file) \
path/file |diff-highlight | less -R

修正
ex.適用を試みたpatchからファイルを持ってくる

 H=`cat .git/rebase-apply/original-commit`; \
N=`git show --pretty="format:" --name-only $H`; \
git checkout $H $N

ex.rebase前のheadからファイルを持ってくる

git checkout `cat .git/rebase-apply/head-name` `git ls-files -m | uniq`

参考:
http://stackoverflow.com/questions/10018533/is-it-possible-to-git-status-only-modified-files

追加

git add -u

以前のcommitメッセージを流用

git commit -a -C `cat .git/rebase-apply/original-commit` && git rebase --skip

掃除(ケースバイケース)

git clean -xfd

Rejectファイルの別ファイルへ適用

$ patch aaa/bbb/ccc.txt < xxx/yyy/zzz.txt.rej

めも

このページにはhatena以外のサービスからのコンテンツが埋め込まれています。 hatenaによりGoogle AdSense 広告が埋め込まれています。