- Git 10
37 :デフォルトの名無しさん[]:2014/07/01(火) 20:07:37.99 ID:dBLK7YMD - ローカルリポジトリのブランチhogeにコミットしました
ここでリモートリポジトリのhogeにコミットするはずが、リモートのmasterにコミットしてしまいました。 取り消すにはどうすればいいのでしょうか?
|
- Git 10
40 :37[sage]:2014/07/01(火) 20:24:46.81 ID:dBLK7YMD - git remote -v
origin https://hoge.com/fuga.git (fetch) origin https://hoge.com/piyo.git (push) git add . --all git commit -m "hoge" git push origin master to https://hoge.com/fuga.git master -> master git branch -a したら remotes/origin/HEAD -> origin/master と出てきたんですが、これはhttps://hoge.com/fuga.gitのmasterにコミットされたということですよね?
|
- Git 10
43 :37[sage]:2014/07/01(火) 20:39:43.94 ID:dBLK7YMD - リモートリポジトリをcloneしてmasterブランチのlog見たらコミット履歴にありませんでしたが・・・
どこにコミットされたのでしょうか・・・ >>41 その通りです
|
- Git 10
46 :37[sage]:2014/07/01(火) 22:06:47.31 ID:dBLK7YMD - 質問が不明瞭、かつ書き間違いなどがあり申し訳ありませんでした。
もう一度できるだけ詳しく正確に書くように致します。
|
- Git 10
47 :デフォルトの名無しさん[sage]:2014/07/01(火) 22:21:48.75 ID:dBLK7YMD - git remote -v
origin https://hoge.com/fuga.git (fetch) origin https://hoge.com/fuga.git (push) upstream https://foo.com/fuga.git (fetch) upstream https://foo.com/fuga.git (push) ※「https://hoge.com/fuga.git」は「https://foo.com/fuga.git」をcloneしたもの ↓ git branch -a branchA * branchB master remotes/origin/HEAD -> origin/master ↓ cd c:\users\nullpo\desktop\repo\test\ git add x.cpp git commit -m "save!" 1 file changed, 2 insertions(+), 2 deletions(-) ↓ git push origin master To https://hoge.com/fuga.git dvcx245..9frr0bf master -> master ※ここで「git push origin branchB」とするはずが間違えて「master」にコミットしてしまいました。 ログから判別すると、現状は、https://hoge.com/fuga.gitのmasterブランチにコミットしてしまってると見るべきですよね? ところがhttps://hoge.com/fuga.gitのmasterをcloneしてログを確認してもさっきのコミットが残っておらず、実際変更したはずのファイル(x.cpp)を見ても変わってないんです…。
|