Github repos cloning but tags / branches not updated?

I have cloned several repos from github, although although I know they have branches / tags, I don't need them once I clone them to my local drive. strange. I am trying to list tags (git tag) but nothing works ...
I would look in .git / refs / tags / and that is empty too.

repos in question:
http://github.com/jchris/hovercraft.git
http://github.com/apache/couchdb.git

any ideas? I really need specific tags / branches, not the HEAD of the master

+2


a source to share


2 answers


As mentioned in GitHub remotes :

Running git clone URL

will automatically create a new subfolder, fetch the contents of the repo into that subfolder, then create and checkout the default branch (usually "master").
If there are other branches on the remote you will need to create a local branch to work, likegit checkout -b fix_stuff origin/fix_stuff

The value of all branches should be there, but in the namespace of remotes

your repo.
But you usually only have one remote tracking branch created for you after cloning (by default, usually " master

").

Try git branch -a

or gitk --all

to check if you see them.




As for the tags (usually found in the refs/tags

namespace
), let's hope this isn't a repeat of this problem (March 2010).

Sorry we had a bit of snafu with the tag parser ... tags should appear again when caches are cleared.

+3


a source


Once you've cloned the repository, only the master is set up for you. You can use the remote branch locally with the command:

git checkout -t origin/1.2.x

      

Creates a named local branch 1.2.x

that "tracks" (eg, repels and deletes) the remote branch and switches to it.

As mentioned earlier, you can see all branches (local and remote) with:



git branch -a

      

Tags should be part of the cloned repo automatically. You can see all tags with one of the following:

git tag     # Show bare list of tags.
git tag -n  # Show tags with first line of annotation specified at tag creation.
git tag -n4 # Show tags with 4 lines of annotation, if available.

      

Hope it helps!

+1


a source







All Articles