Difference between revisions of "How to commit to remote branch"

From wikieduonline
Jump to navigation Jump to search
Tags: Mobile web edit, Mobile edit
 
(6 intermediate revisions by 2 users not shown)
Line 3: Line 3:
 
{{git push origin OUTPUT}}
 
{{git push origin OUTPUT}}
  
 +
 +
== Errors ==
 +
  ! [rejected]            [[HEAD]] -> your-branch (non-fast-forward)
 +
error: failed to push some refs to 'gitlab.com:your-project/your-app.git'
 +
hint: Updates were rejected because [[the tip of your current branch is behind]]
 +
hint: its remote counterpart. Integrate the remote changes (e.g.
 +
hint: '[[git pull]] ...') before pushing again.
 +
hint: See the 'Note about [[fast-forwards]]' in '[[git push --help]]' for details.
 +
 +
 +
git push origin HEAD:remotes/origin/your-branch
 +
error: The destination you provided is not a full [[refname]] (i.e.,
 +
starting with "refs/"). We tried to guess what you meant by:
 +
 +
- Looking for a ref that matches 'remotes/origin/your-branch' on the remote side.
 +
- Checking if the <src> being pushed ('HEAD')
 +
  is a ref in "refs/{heads,tags}/". If so we add a corresponding
 +
  refs/{heads,tags}/ prefix on the remote side.
 +
 
 +
Neither worked, so we gave up. You must fully qualify the ref.
 +
hint: The <src> part of the [[refspec]] is a commit object.
 +
hint: Did you mean to create a new branch by pushing to
 +
hint: 'HEAD:refs/heads/remotes/origin/your-branch'?
 +
error: failed to push some refs to 'bitbucket.org:your-project/your-repo.git'
 +
 +
Solution: remove "remotes/origin:"  git push origin HEAD:your-branch
  
 
== Related ==
 
== Related ==
 
* <code>[[git add]]</code>
 
* <code>[[git add]]</code>
 +
* <code>[[git push]]</code>
 
* [[Make Local Changes and Update remote Repositories]]
 
* [[Make Local Changes and Update remote Repositories]]
  

Latest revision as of 12:38, 17 March 2023


git push origin HEAD:your-name-of-remote-branch
Enumerating objects: 21, done.
Counting objects: 100% (21/21), done.
Delta compression using up to 8 threads
Compressing objects: 100% (11/11), done.
Writing objects: 100% (11/11), 5.48 KiB | 801.00 KiB/s, done.
Total 11 (delta 9), reused 0 (delta 0), pack-reused 0
remote:
remote: View merge request for your-name-of-remote-branch:
remote:   https://gitlab.com/your-project/your-app/-/merge_requests/2913
remote:
To gitlab.com:your-project/your-app.git
   7caef6a60..f942d7435  HEAD -> your-name-of-remote-branch


Errors[edit]

 ! [rejected]            HEAD -> your-branch (non-fast-forward)
error: failed to push some refs to 'gitlab.com:your-project/your-app.git'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Integrate the remote changes (e.g.
hint: 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.


git push origin HEAD:remotes/origin/your-branch
error: The destination you provided is not a full refname (i.e., 
starting with "refs/"). We tried to guess what you meant by:

- Looking for a ref that matches 'remotes/origin/your-branch' on the remote side.
- Checking if the <src> being pushed ('HEAD')
  is a ref in "refs/{heads,tags}/". If so we add a corresponding
  refs/{heads,tags}/ prefix on the remote side.
 
Neither worked, so we gave up. You must fully qualify the ref.
hint: The <src> part of the refspec is a commit object.
hint: Did you mean to create a new branch by pushing to
hint: 'HEAD:refs/heads/remotes/origin/your-branch'?
error: failed to push some refs to 'bitbucket.org:your-project/your-repo.git'
Solution: remove "remotes/origin:"  git push origin HEAD:your-branch

Related[edit]

See also[edit]

Advertising: