git remote repo로 여러 개의 커밋을 푸시하고 싶습니다.git : 단일 커밋하기, 리베이스를 사용하여 재정렬하기, 커밋 커밋하기
How can I pushing specific commit to a remote, and not the previous commits?
을 내가 밀어 원하는 커밋 머리에 있지, 그래서 내가 먼저 리베이스를 사용하여 커밋 순서를하고 난 그렇게하려면 다음 지침을 사용 : 나는 제프의 대답은 그렇게 여기에서 찾을 다음 :
http://gitready.com/advanced/2009/03/20/reorder-commits-with-rebase.html
는 기본적으로 나는 짓을했는지 :
git clone
git commit
git commit
...
git pull
git rebase -i HEAD~3
git push origin <SHA>:master
나는 오류가이 일을 얻었다. 그래서 나는 그 문제를 더 깊이 들여다보기 시작했다.
git: Duplicate Commits After Local Rebase Followed by Pull
로저의 응답이 나를 인도 :
git clone
git commit
git commit
...
git pull
git log --pretty=format:"%h - %an : %s" // log before rebasing
git rebase -i HEAD~3
git pull
git log --pretty=format:"%h - %an : %s" // log after rebasing
git pull
git log --pretty=format:"%h - %an : %s" // log after rebasing after pulling
그래서 나는이 질문을 게시 : 내가 예를 들어, 리베이스 한 후 두 번째 자식 풀을 할 경우 내 로그에 중복 커밋이 있다는 것을 발견 이 질문에 : rebasing과 pulling 후에 중복 된 커밋을 보는 이유는 무엇입니까?
위에서, 리베이스 전에 로그 보이는 같은 :
84e4015 - Me : Local Commit 3
0dbe86a - Me : Local Commit 2
d57ba2a - Me : Merge branch 'master' of remote repository
a86ea35 - Me : Local Commit 1 before reordering
2fc4fe7 - Remote User 2 : Remote Commit 2
b7a8656 - Remote User 1 : Remote Commit 1
8ce80fc - Me : Merge branch 'master' of remote repository
그리고 리베이스 후 로그는 다음과 같습니다
cf1ff7b - Me : Local Commit 3
cd14463 - Me : Local Commit 2
b9d44fb - Me : Local Commit 1 after reordering
9777c56 - Remote User 2 : Remote Commit 2
a2d7d8b - Remote User 1 : Remote Commit 1
8ce80fc - Me : Merge branch 'master' of remote repository
공지 사항 원래 2 2fc4fe7 커밋 b7a8656이 새의 SHA을 가지고; 9777c56 및 a2d7d8b. 나는 이것이 이것이 문제의 시작이라고 믿는다. 나는 또 다른 자식이 로그는 다음과 같습니다 당겨 할 후
은 이제 : 원격 커밋 지금 중복되는
e8e1a85 - Me : Merge branch 'master' of remote repository
cf1ff7b - Me : Local Commit 3
cd14463 - Me : Local Commit 2
b9d44fb - Me : Local Commit 1 after reordering
9777c56 - Remote User 2 : Remote Commit 2
a2d7d8b - Remote User 1 : Remote Commit 1
2fc4fe7 - Remote User 2 : Remote Commit 2 // duplicate 2
b7a8656 - Remote User 1 : Remote Commit 1 // duplicate 1
8ce80fc - Me : Merge branch 'master' of remote repository
공지 사항, 원격의 원래의 SHA는 2fc4fe7 및 b7a8656 커밋 돌아왔다.
로저의 반응에 따르면 그는 다른 사람들이 git을 밀고 잘못을 저지른 것처럼 보이고 이미 밀린 커밋을 리베이스하고 있다고 말했다. 하지만 로컬로 푸시 커밋 rebase 내 잘못이라고 생각합니다.
이미 리모컨에 푸시 된 커밋을 리베이스했기 때문에 이렇게 할 수 있습니까? 그렇다면 이것을 피하기 위해 무엇을해야합니까? 나는 하나의 커밋을 푸시 할 수 있도록 커밋을 리베이스해야한다. 이 작업을 위해 분기 시스템을 사용해야합니까? 그렇다면이 문제를 해결하기 위해 지점을 어떻게 사용합니까?
가능한 [Git 커밋은 중복 된 후에 같은 분기에서 리베이스를 반복합니다] (http://stackoverflow.com/questions/9264314/git-commits-are-duplicated-in-the-same-branch-after -doing-a-rebase) – Whymarrh