From: "Björn Steinbrink" <B.Steinbrink@gmx.de>
To: Auguste Mome <augustmome@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: can't create a branch on remote
Date: Fri, 9 Oct 2009 23:54:36 +0200 [thread overview]
Message-ID: <20091009215436.GA21017@atjola.homenet> (raw)
In-Reply-To: <17cb70ee0910091435l4c4d1736hf4d403a2fe6331a2@mail.gmail.com>
On 2009.10.09 23:35:03 +0200, Auguste Mome wrote:
> # git branch mylocal26217 v2.6.21.7
This automatically peels the v2.6.21.7 tag to get the commit object, and
creates the new branch head, referencing that commit.
> # git push /home/user/dev/git/linux-2.6
> v2.6.21.7:refs/heads/new_feature_name26217
> Total 0 (delta 0), reused 0 (delta 0)
> error: Trying to write non-commit object
> 170684ef0557d4b711a86595d31dcbebcb9d4ba2 to branch
> refs/heads/new_feature_name26217
This didn't peel the tag, because you might actually want the remote ref
to reference the tag, not the commit referenced by the tag. So you tried
to create a branch head that would reference a tag, and that is not
allowed. To peel the tag you can use:
v2.6.21.7^0
v2.6.21.7^{commit}
v2.6.21.7^{}
The first two ensure that you actually get a commit object or an error,
the last one just peels the tag until it finds a non-tag object.
So:
git push /home/user/dev/git/linux-2.6 \
v2.6.21.7^0:refs/heads/new_feature_name26217
should do the trick.
Though I don't see why you would create a branch like that. Usually, I'd
expect you to create new_feature_name26217 locally, work on it, and then
just push that branch head, instead of creating that rather pointless
branch head remotely.
Björn
next prev parent reply other threads:[~2009-10-09 21:57 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-10-09 21:35 can't create a branch on remote Auguste Mome
2009-10-09 21:54 ` Björn Steinbrink [this message]
2009-10-09 22:08 ` Jakub Narebski
2009-10-12 7:19 ` Auguste Mome
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20091009215436.GA21017@atjola.homenet \
--to=b.steinbrink@gmx.de \
--cc=augustmome@gmail.com \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).