LoginSignup
0
0

More than 3 years have passed since last update.

git push -u origin xxx の意味が分からないので調べてみた

Last updated at Posted at 2020-02-04
[student@workstation DO288-apps]$git checkout -b source-build
Switched to a new branch 'source-build'
[student@workstation DO288-apps]$git push -u origin source-build...output omitted...
* [new branch]      source-build -> source-build
Branch source-build set up to track remote branch source-build from origin.

これの意味が分からないので、調べてみた。

リンクのみ提示の他力本願。

git push -u の-uの意味。
https://qiita.com/shumpeism/items/1b8027c8905ca826416d

origin とか master の意味。
https://qiita.com/seri1234/items/e651b3e108a695a92809

結論としては、ローカルで作成したブランチ source-build での変更を、リモートリポジトリの source-build ブランチに紐づける設定?
ローカルブランチは暗黙(前のコマンドgit checkout -bでスイッチしているから)で、git push -u origin source-build で指定している originもsource-buildもリモートリポジトリ上のリソースを指定。
でもローカルブランチ source-buildとリモートブランチ source-buildは一致させておかないと駄目なようだ(エラーになった)。

0
0
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
0