0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

gitの初回push時に自動的にリモートにブランチを作成する

0
Posted at

概要

ローカルで作成したブランチを初回pushする際に

fatal: The current branch hoge-hoge-branch has no upstream branch.
To push the current branch and set the remote as upstream, use

git push --set-upstream origin hoge-hoge-branch

To have this happen automatically for branches without a tracking
upstream, see 'push.autoSetupRemote' in 'git help config'.

と言う注意が出て、git pushのコマンドをコピペする。
push.autoSetupRemoteのconfigを参照せよ。と言う事をgit側から提示されている。

gitのconfigとして設定してね。との旨。

$ git config --global push.autoSetupRemote ture

をglobalに設定する。これで初回pushの際に自動的にブランチが作成される。
今の御時世だとClaudeとかでcommitしといてーと命令も出来るけど、結局何のコマンドだっけ?が多くなる40代

falseにする時は来るのだろうか。

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?