3

私のローカルマシンには、次のように設定されたリポジトリがあります

* remote origin
  Fetch URL: git@github.com:me/my_project.git
  Push  URL: git@github.com:me/my_project.git
  HEAD branch: master
  Remote branches:
    mac-master tracked
    master     tracked
  Local branch configured for 'git pull':
    master merges with remote master
  Local ref configured for 'git push':
    master pushes to master (local out of date)

ローカルmasterにはブランチしかないので、常にローカルマスターをリモートブランチにプッシュしたいと思います。私はただやるべきですか: mac-master

git push origin master:mac-master

プッシュする必要があるたびに?そうでない場合、それを行う正しい方法は何ですか?

4

2 に答える 2

6

いつもやりたいなら、

$ git push -u remote master:mac-master

一度。フラグは-uオプションを設定するので、後で次のことができます。

$ git push

にプッシュmastermac-masterますremote

于 2012-07-31T16:40:31.793 に答える
5

ブランチが追跡しているリモートのブランチは、次の方法で変更できます。

git branch --set-upstream   branch_name   your_remote/other_branch_name

branch_nameこのように、 toのプッシュはyour_remoteに行われother_branch_nameます。

于 2012-07-31T16:44:24.767 に答える