Given a git refname, can I detect whether it's a hash, tag, or branch?
I'm writing a script that will take in a specification used as the base
for creating a branch. Thus, it will have something like this:
git checkout -b $newbranch $startingpoint
Now, startingpoint can be specified either as a branch name, a tag, or a
SHA1.
Later in the script, I need to do different things based on what
startingpoint actually is. Is had thought git rev-parse would give me this
information, but I cannot seem to bend it to my whim.
Is there a git way, preferably a porcelain, to get the information I seek?
No comments:
Post a Comment