質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.50%
Git

Gitはオープンソースの分散バージョン管理システム(DVCS)です。

GitHub

GitHubは、Gitバージョン管理システムを利用したソフトウェア開発向けの共有ウェブサービスです。GitHub商用プランおよびオープンソースプロジェクト向けの無料アカウントを提供しています。

Q&A

解決済

1回答

18023閲覧

GitHubからpull requestができない

nakaya___

総合スコア7

Git

Gitはオープンソースの分散バージョン管理システム(DVCS)です。

GitHub

GitHubは、Gitバージョン管理システムを利用したソフトウェア開発向けの共有ウェブサービスです。GitHub商用プランおよびオープンソースプロジェクト向けの無料アカウントを提供しています。

0グッド

0クリップ

投稿2019/03/22 10:29

現在、リモートリポジトリにmasterとuiの2つのブランチがあります。

GitHub上からpull requestを送ろうとしたのですが、"There isn’t anything to compare.
master and ui are entirely different commit histories."というメッセージが表示され、プルリクを送ることができません。

git reflogにて過去履歴を見てみたのですが、以下のようになっていました。

fa3f220 (HEAD -> ui, origin/ui) HEAD@{0}: commit: Remove unnecessary comments for BookListViewController a062058 HEAD@{1}: commit: Fix swiftLint rules f1a65a3 HEAD@{2}: commit: Fix Autolayout for BookAddView 14059cd HEAD@{3}: commit: Fix validation 8eff9f8 HEAD@{4}: commit: Add BookListCells be7d0ea HEAD@{5}: commit: Fix NavigationBar for BookEditView 118cf18 HEAD@{6}: commit: Fix validations 49ba619 HEAD@{7}: commit: Add Validation 9ea23aa HEAD@{8}: commit: Fix clear button for SignInView 986a370 HEAD@{9}: commit: Add save button for BookAddView 2b22d58 HEAD@{10}: commit: Add constraints for BookAddView 7e0b29f HEAD@{11}: commit: Add constraints for BookEditView d04ac11 HEAD@{12}: commit: Fix Tabbar buttons of fonts e217e99 HEAD@{13}: commit: Add image, button, label and textfield for BookEditView 1dc860c HEAD@{14}: commit: Add accessoryButton for BookListView 4a25343 HEAD@{15}: commit: Add BookEditViewController f5d09c4 HEAD@{16}: commit: Add title for BookAddView 941f17d HEAD@{17}: commit: Add NavigationButton in BookListView feacc3e HEAD@{18}: commit: Fix issue of LogouView does not present 3ad0130 HEAD@{19}: commit: Rename Main.storyboard bceb55a HEAD@{20}: commit: Add SignUp.storyboard 38adc60 HEAD@{21}: commit: Fix NavigationBar issue for title does not appear 6e2a58c HEAD@{22}: commit: Add image, label and textfield for BookAddView 40631c9 HEAD@{23}: commit: Add BookListViewController 2477eb5 HEAD@{24}: commit: Fix NavigationController 29d13b5 HEAD@{25}: commit: Fix LogoutViewController of view 40efd80 HEAD@{26}: commit: Add LogoutViewController 82bdd16 HEAD@{27}: commit: Fix TabBarItems layout 66dc98c HEAD@{28}: commit: Remove unnecessary comments 2b5c5a8 HEAD@{29}: commit: Fix NavigationController e0856ea HEAD@{30}: commit: Add MainTabBarController 00d1ec5 HEAD@{31}: commit: Add TableView to BookIndexViewController d70aadc HEAD@{32}: commit: Fix BookIndexView appear in first view f01b91b HEAD@{33}: commit: Make BookInddxViewController 3a568e7 HEAD@{34}: commit: Add Constraints for SignUpViewController a54ea1d HEAD@{35}: commit: Add Constraints for SignInViewController e319226 HEAD@{36}: commit: Make SignInViewConttoller and SignUpViewController 31315d4 HEAD@{37}: commit (amend): Initial Commit 21920ff (origin/master, origin/HEAD, master) HEAD@{38}: checkout: moving from master to ui 21920ff (origin/master, origin/HEAD, master) HEAD@{39}: clone: from https://github.com/hnakano-cq/BookManager-ios.git``` 原因としてuiブランチへcheckoutしたあとInitial Commit(masterブランチでコミット&プッシュした)のauthor&commiterを書き換えてしまったことが原因のような気がしますが、、。 恐れ入りますが、解決方法をご教示いただきたく存じます。

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

guest

回答1

0

ベストアンサー

おっしゃる通りで、このように別のブランチ (枝分かれしてないので「ブランチ」ではないな) になっていますね。

masterにuiをmergeしてやればどうでしょうか。

sh

1$ git checkout ui 2$ git pull 3$ git checkout master 4$ git pull 5$ git merge --no-ff ui 6$ git push origin master

投稿2019/03/22 14:17

編集2019/03/23 06:32
ikedas

総合スコア4229

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

nakaya___

2019/03/26 02:52

ありがとうございます。上記、コマンドによって解決することができました。
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.50%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問