어떻게 변경 내용을 볼 수 없는 그 둘 사이에 커밋한 커밋한?

어떻게 하면 '깃 (git) 을 제외한 나머지 두 개 사이에 차이를 보이기 diff' 커밋한 커밋한 중간입니까?

질문에 대한 의견 (3)

git 으로 diff 커밋한 다음과 같은 2 차 서류심사에서 됩니다

-> git diff 0da94be  59ff30c > my.patch
-> git apply my.patch
해설 (14)

수 없이 그 사이의 차이를 묻는 / 2 / 커밋한 커밋한 거의 없다. 단지 스냅샷입니다 커밋한 내용에 대한 리포지토리를. 그 차이를 묻는 것은 두 가지 있습니다. 따라서 중요한 것은 정말 찾고, 뭐 그런?

이에 따라 윌리엄 체리 따기 리베이스 커밋합니다 위에 또 다른 하나의 변동분 얻을 수 있습니다. 즉:

$ git checkout 012345
$ git cherry-pick -n abcdef
$ git diff --cached

39, & # 39, 이 경우 커밋합니다 abcdef& 비교하고, 그 후 즉시 & # 39 위에 difference_ _that qic redhat. 조상, 012345& # 39;. 이 새로운 차이는, & # 39 에서 가져온 변화는 컨텍스트로 어졌다면 표시됩니까 - 유일한 012345& # 39. # 39, & # 39 의 아닌 abcdef& 즉시인지 조상. 물론 충돌함 등을 얻을 수 있기 때문에, 대부분의 경우 매우 유용한 프로세스가 it& # 39 일은 아닙니다.

39 you& 압스데프 자체에 관심이 있는 경우, re 그냥 할 수 있습니다.

$ git log -u -1 abcdef

이 수치는 최근 압스데프 즉시인지 조상, 홀로 보통 그리웠댔지.

물론

$ git diff 012345..abcdef

이러한 두 가지 커밋한 너회들을 보기입니다 차이점.

39 더 좋은 아이디어를 얻기 위해 it 보호하리요 뭐한테 you&, re trying to developer. - 앞서 언급했듯이, 차이를 묻는 what& # 39, s, t # 39 doesn& 사이에 두 커밋한 쉽게 이해할 수 없는 사실.

해설 (6)

깃 (git) 로 사용할 수 있는 패치를 diff 명령은 1 및 2 커밋한 12345 압스데프 비교할 수 있다


diff 
해설 (6)
git diff   path

예:

git diff commit1 commit2 config/routes.rb

그 사이에 해당 파일의 커밋한 it 차이점을 보여 줍니다.

해설 (0)

S # 39 라고 let& 이 있습니다.

A
|
B    A0
|    |
C    D
\   /
  |
 ...

'A' 는 것을 확인할 수 있도록 하려면 동일합니까 'A0'.

이 전략은 이 일을 할 것이다.

$ git diff B A > B-A.diff
$ git diff D A0 > D-A0.diff
$ diff B-A.diff D-A0.diff
해설 (1)
  • 확인하는 changes:* 완료하십시오
  git diff  
  • 변경된 files:* 확인하는 추가 / 삭제 /
  git diff   --name-only
  • 참고 *: Diff 확인하는 don& # 39 를 넣을 수 없는 경우, 그 사이에 커밋합니다 t need 커밋합니다 받고 있다.
해설 (0)

예를 들어, 보고 싶은 커밋한 012345 및 압스데프 의 차이점은. 다음 어떻게해야합니다 그리웠댔지:

&lt pre>; 깃 (git) 012345 체크아웃합니다 $ 깃 (git) $ 뻨을 압스데프 체리 선택 diff - $ git 캐싱된 &lt /pre>;

해설 (1)

이건 뭐야.

git diff abcdef 123456 | less

39 의 it& 그냥 파이프 redhat. 비교할 때 덜 스케쳐내 즉석에서 여러 차이점.

해설 (0)

깃 (git) '에서' 설정 '~' 내 '앨리어스가 /.bashrc 파일의 diff'.

alias gdca='git diff --cached' # diff between your staged file and the last commit
alias gdcc='git diff HEAD{,^}' # diff between your recent tow commits

Not my english 는 네이티브 언어 입력 오류를 좀 주십시오.

해설 (0)

깃 (git) 을 사용하여 간단히 2.19, 이후 수 있습니다.

"'git diff 범위 rev1.rev2"'

  • 2 에 따라 공통조상 진단트리 커밋합니다 비교

또는 "'git diff 범위 .rev1 rev2 .rev2 rev1 ~ ~"

  • 비교하십시오 커밋한 변경 등을 선보인 2
해설 (0)

내가 잘 보여 주는, diff 는 두 개 사이에 작성했습니까 스크립트입니다 커밋한 unbuntu.

https://gist.github.com/jacobabrahamb4/a60624d6274ece7a0bd2d141b53407bc

#!/usr/bin/env python
import sys, subprocess, os

TOOLS = ['bcompare', 'meld']

def getTool():
    for tool in TOOLS:
        try:
            out = subprocess.check_output(['which', tool]).strip()
            if tool in out:
                return tool
        except subprocess.CalledProcessError:
            pass
    return None

def printUsageAndExit():
    print 'Usage: python bdiff.py   '
    print 'Example: python bdiff.py  0 1'
    print 'Example: python bdiff.py  fhejk7fe d78ewg9we'
    print 'Example: python bdiff.py  0 d78ewg9we'
    sys.exit(0)

def getCommitIds(name, first, second):
    commit1 = None
    commit2 = None
    try:
        first_index = int(first) - 1
        second_index = int(second) - 1
        if int(first) < 0 or int(second) < 0:
            print "Cannot handle negative values: "
            sys.exit(0)
        logs = subprocess.check_output(['git', '-C', name, 'log', '--oneline', '--reverse']).split('\n')
        if first_index >= 0:
            commit1 = logs[first_index].split(' ')[0]
        if second_index >= 0:
            commit2 = logs[second_index].split(' ')[0]
    except ValueError:
        if first != '0':
            commit1 = first
        if second != '0':
            commit2 = second
    return commit1, commit2

def validateCommitIds(name, commit1, commit2):
    if commit1 == None and commit2 == None:
        print "Nothing to do, exit!"
        return False
    try:
        if commit1 != None:
            subprocess.check_output(['git', '-C', name, 'cat-file', '-t', commit1]).strip()
        if commit2 != None:
            subprocess.check_output(['git', '-C', name, 'cat-file', '-t', commit2]).strip()
    except subprocess.CalledProcessError:
        return False
    return True

def cleanup(commit1, commit2):
        subprocess.check_output(['rm', '-rf', '/tmp/'+(commit1 if commit1 != None else '0'), '/tmp/'+(commit2 if commit2 != None else '0')])

def checkoutCommit(name, commit):
    if commit != None:
        subprocess.check_output(['git', 'clone', name, '/tmp/'+commit])
        subprocess.check_output(['git', '-C', '/tmp/'+commit, 'checkout', commit])
    else:
        subprocess.check_output(['mkdir', '/tmp/0'])

def compare(tool, commit1, commit2):
        subprocess.check_output([tool, '/tmp/'+(commit1 if commit1 != None else '0'), '/tmp/'+(commit2 if commit2 != None else '0')])

if __name__=='__main__':
    tool = getTool()
    if tool == None:
        print "No GUI diff tools"
        sys.exit(0)
    if len(sys.argv) != 4:
        printUsageAndExit()

    name, first, second = None, 0, 0
    try:
        name, first, second = sys.argv[1], sys.argv[2], sys.argv[3]
    except IndexError:
        printUsageAndExit()

    commit1, commit2 = getCommitIds(name, first, second)

    if not validateCommitIds(name, commit1, commit2):
        sys.exit(0)

    cleanup(commit1, commit2)
    checkoutCommit(name, commit1)
    checkoutCommit(name, commit2)

    try:
        compare(tool, commit1, commit2)
    except KeyboardInterrupt:
        pass
    finally:
        cleanup(commit1, commit2)
    sys.exit(0)
해설 (0)

깃 (git) '에서' 설정 '~' 내 '앨리어스가 /.zshrc 파일의 diff'.

alias gdf='git diff HEAD{'^',}' # diff between your recent tow commits

감사합니다 @Jinmiao 얻었다

해설 (0)