Our repo happens to have a tag that has the same name as the branch name. So when I try to pull from that branch, git confused and pulled from tag, like this. I have to delete that tag first to make my git pull work.
So how do I tell git pull from branch not from tag ?
cc-backend ➤ git pull origin 0.9.0-rc6-patch1
From 10.0.0.28:webcc/cc-backend
* tag 0.9.0-rc6-patch1 -> FETCH_HEAD
Already up to date.
/* I have to delete that tag and git pull again to get the result I want */
cc-backend ➤ git pull origin 0.9.0-rc6-patch1
From 10.0.0.28:webcc/cc-backend
* branch 0.9.0-rc6-patch1 -> FETCH_HEAD
Updating 9d7e9dc3..2bf3f96a
Fast-forward
app/Services/GroupSeat/Seat.php | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
It seems the remote repository has a tag and a branch with the same name 0.9.0-rc6-patch1
. Use the full name to fetch/pull,
# fetch/pull the tag
git fetch/pull origin refs/tags/0.9.0-rc6-patch1
# fetch/pull the branch
git fetch/pull origin refs/heads/0.9.0-rc6-patch1
You should use the full name like
git checkout refs/heads/<branchname>
or for tag
git checkout refs/tags/<refname>
For pull
git pull origin refs/heads/<branchname>
To access the relevant documentation type in
git help revisions
Refer the SPECIFYING REVISIONS
section
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