Difference between revisions of "Git push --set-upstream / -u"
Jump to navigation
Jump to search
↑ https://devconnected.com/how-to-push-git-branch-to-remote/
(7 intermediate revisions by the same user not shown) | |||
Line 3: | Line 3: | ||
[[git push --set-upstream]] / -u | [[git push --set-upstream]] / -u | ||
− | [[git push --set-upstream origin]] feature/newbranch | + | [[git push --set-upstream origin yournewbranch]] |
+ | [[git push --set-upstream origin]] [[feature/]]newbranch | ||
[[git push --set-upstream origin master]] | [[git push --set-upstream origin master]] | ||
Line 14: | Line 15: | ||
* [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 21: | Line 26: | ||
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 == |
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 27: | Line 32: | ||
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 34: | Line 43: | ||
* [[Git: upstream]] | * [[Git: upstream]] | ||
* <code>[[git push --dry-run]]</code> | * <code>[[git push --dry-run]]</code> | ||
− | * [[git add .]] | + | * <code>[[git add .]]</code> |
* <code>[[Git: upstream]]</code> | * <code>[[Git: upstream]]</code> | ||
* <code>[[git remote show origin]]</code> | * <code>[[git remote show origin]]</code> |
Latest revision as of 11:13, 19 January 2024
git push --set-upstream / -u
git push --set-upstream origin yournewbranch git push --set-upstream origin feature/newbranch git push --set-upstream origin master
git push --set-upstream origin master Enumerating objects: 3, done. Counting objects: 100% (3/3), done. Writing objects: 100% (3/3), 223 bytes | 44.00 KiB/s, done. Total 3 (delta 0), reused 0 (delta 0) To codecommit::us-east-1://your_repo * [new branch] master -> master 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 error: src refspec main does not match any error: failed to push some refs to '[email protected]:xxxxx/yyyyy.git'
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. [1]
Errors[edit]
git push --set-upstream your-branch fatal: 'yourbranch' does not appear to be a git repository fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists. Solution: you forgot to add origin
Fatal: The current branch has no upstream branch
Related terms[edit]
git status
git remote add
git push
- Git: upstream
git push --dry-run
git add .
Git: upstream
git remote show origin
See also[edit]
git push
[-v
|--set-upstream | -o | --set-upstream origin master
|-u origin main
|origin master
|-u origin master
|--delete master
|-u | origin HEAD | --dry-run
], Git: upstream,git push --force
git
: [config | init | status ]
,git add
,git rm
,git commit
,git push, git pull
,.gitconfig
,.gitignore
,git
(clone
,fetch
,pull
),git tag
,git log
,git blame
, Merge Request, LFS,git branch
,git apply
,git rebase
,git diff
,git diff-tree
,git config --global
,remote | submodule | request-pull
,GIT_TRACE, GIT_CURL_VERBOSE
,clean
,main
,git show-ref
,git reset
,git prune
,git ls-remote origin
,git checkout
,git switch
,pathspec
,git credential-osxkeychain
,git version
,pre-commit
,git --help
, GitBook,refs/
Advertising: