Editing Git push --set-upstream / -u

Jump to navigation Jump to search

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.

Latest revision Your text
Line 3: Line 3:
 
  [[git push --set-upstream]] / -u
 
  [[git push --set-upstream]] / -u
  
  [[git push --set-upstream origin yournewbranch]]
+
  [[git push --set-upstream origin]] feature/newbranch
[[git push --set-upstream origin]] [[feature/]]newbranch
 
 
  [[git push --set-upstream origin master]]
 
  [[git push --set-upstream origin master]]
  
Line 15: Line 14:
 
  * [new branch]      master -> master
 
  * [new branch]      master -> master
 
  Branch 'master' set up to track remote branch 'master' from 'origin'.
 
  Branch 'master' set up to track remote branch 'master' from 'origin'.
 
git push --set-upstream origin yourbranch
 
branch 'yourbranch' set up to track 'origin/yourbranch'.
 
Everything up-to-date
 
  
 
  [[git push --set-upstream]] origin [[main]]
 
  [[git push --set-upstream]] origin [[main]]
Line 26: Line 21:
 
  if your upstream branch is not already created, you will need to create it by running the “git push” command with the “-u” option for upstream. <ref>https://devconnected.com/how-to-push-git-branch-to-remote/</ref>
 
  if your upstream branch is not already created, you will need to create it by running the “git push” command with the “-u” option for upstream. <ref>https://devconnected.com/how-to-push-git-branch-to-remote/</ref>
  
== Errors ==
+
== Error ==
 
  git push --set-upstream your-branch
 
  git push --set-upstream your-branch
 
  fatal: 'yourbranch' does not appear to be a git repository
 
  fatal: 'yourbranch' does not appear to be a git repository
Line 32: Line 27:
 
  Please make sure you have the correct access rights
 
  Please make sure you have the correct access rights
 
  and the repository exists.
 
  and the repository exists.
 
Solution: you forgot to add [[origin]]
 
 
[[Fatal: The current branch has no upstream branch]]
 
  
 
== Related terms ==
 
== Related terms ==
Line 43: Line 34:
 
* [[Git: upstream]]
 
* [[Git: upstream]]
 
* <code>[[git push --dry-run]]</code>
 
* <code>[[git push --dry-run]]</code>
* <code>[[git add .]]</code>
+
* [[git add .]]
 
* <code>[[Git: upstream]]</code>
 
* <code>[[Git: upstream]]</code>
 
* <code>[[git remote show origin]]</code>
 
* <code>[[git remote show origin]]</code>

Please note that all contributions to wikieduonline may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see Wikieduonline:Copyrights for details). Do not submit copyrighted work without permission!

Cancel Editing help (opens in new window)

Templates used on this page:

Advertising: