Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

リモートへプッシュできない

Hitomi Nishigori
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
October 1, 2019

お世話になっております。

リモートブランチに存在するmasterから、orign/masterをチェックアウトする方法で名称を変更し、ローカルにブランチを作っています。

例えば「xxx」という名前で新規ローカルブランチを作成し、作業したあとリモートへプッシュしようとするのですが、「プッシュするブランチ」に何もでてきません。

いつもならプッシュするブランチに、作成したブランチ名「xxx」がローカルブランチ/リモートブランチとして表示されるのですが、一度SouceTreeの調子が悪くなり再インストールした後から何も出なくなってしまいました。

(コミット後、すぐにプッシュのチェックを入れておくとリモートにブランチが作成されることがわかりました。)

なお、すでにリモートブランチに存在するブランチに対しては、ローカルにチェックアウトしたあと、普通にプッシュ作業が可能です。

新規ブランチのみ、この現象が起こります。

なお、関係あるか分かりませんがSouceTreeを利用するうえでBitbacketアカウントを登録しないと先へ進めなかったため登録していますが、実際にはGitLabと連携して利用しています。

GitLabのブラウザ上から、リモート環境にnew branch を作り、リモート環境からローカルに落としたうえで作業すればよいのですが、ひと手間かかってしまいます。

---

追記

ローカルブランチにmasterを落とした上で、そのmasterからブランチを作ると問題なく「プッシュするブランチ」に表示がされました。

リモートブランチに存在するmasterから、orign/masterをチェックアウトする方法と何が違うのか分かりません・・・

 

一応の解決はしたのですが、どう仕組みが違うのか分かりますでしょうか?

お手数ですが、ご教授いただけますと幸いです。よろしくお願いいたします。

1 answer

0 votes
Brant Schroeder
Community Champion
February 11, 2026

@Hitomi Nishigori welcome to the Atlassian community

What you are doing is correct.  In Git you would have to do an initial push using the -u flag to identify the master.  After this initial push with the -u flag, you can use git push without any flags to push future changes to the same branch.  In sourcetree after you identify the master as you are doing the push works.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events