I have got a commit-id, currently it doesn't belong to any of the branch. It has got a label. How do I push this commit to server?
git show 2.0.rc10
tag 2.0.rc10
Tagger: ....
Date: Fri Mar 29 13:38:55 2013 -0700
Release 2.0.rc10; merged
commit f1186bfeb938081f9d57f8ac20667329b1c53111
while running
git branch -r --contains f1186bfeb938081f9d57f8ac20667329b1c53111
there is no output.
How to push this commit to server?
git push origin 2.0.rc10
remote: Tag '2.0.rc10' references unknown objects. Push commits before tags.
To
! [remote rejected] 2.0.rc10 -> 2.0.rc10 (pre-receive hook declined)
error: failed to push some refs to 'remote'
Create a new branch with git checkout -b <branch_name> , and push it with git push -u origin <branch_name> . Then, everyone can see your branch, and if you need to make changes to it, it's as straightforward as changing to the branch, committing, and pushing it up.
No, git push only pushes commits from current local branch to remote branch that you specified in command.
The git prune command is an internal housekeeping utility that cleans up unreachable or "orphaned" Git objects. Unreachable objects are those that are inaccessible by any refs. Any commit that cannot be accessed through a branch or tag is considered unreachable. git prune is generally not executed directly.
Your problem is not Git, but a pre-receive hook on the server that apparently checks that the commit is referenced by a branch.
Obviously, a solution is to push your branch first. I'm not sure why you would want a tag without a branch.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With