no code is downloaded after executing a git fetch
I'm trying to use hub in combination with git.
Note: hub simplifies git usage when you host your code on github.When I do a fetch it looks like the repository is fetched:
udos@X100e:/var/www/mantisbt$ git fetch
remote: Counting objects: 54427, done.
remote: Compressing objects: 100% (9435/9435), done.
remote: Total 54427 (delta 44510), reused 54427 (de开发者_如何转开发lta 44510)
Receiving objects: 100% (54427/54427), 19.20 MiB | 395 KiB/s, done.
Resolving deltas: 100% (44510/44510), done.
From github.com:udos/mantisbt
* [new branch] manzen -> origin/manzen
* [new branch] master -> origin/master
* [new branch] votes_refactor -> origin/votes_refactor
* [new tag] manzen_first_working_prototype -> manzen_first_working_prototype
But when taking a look at the directory, it's not there:
udos@X100e:/var/www/mantisbt$ ls -al
total 12
drwxr-xr-x 3 udos udos 4096 2011-02-12 23:01 .
drwxr-xr-x 12 root root 4096 2011-02-12 21:07 ..
drwxr-xr-x 8 udos udos 4096 2011-02-12 23:02 .git
Any ideas what's wrong here?
Fetch only downloads the changes from the remote, to apply the upstream changes changes use pull or merge. If you're starting from scratch, perhaps you want to clone the repo first though?
Found it. Fetch does indeed download objects and refs. The trick is that they are hidden.
A simple
udos@X100e:/var/www/mantisbt$ git branch
returns nothing.
Instead
udos@X100e:/var/www/mantisbt$ git branch -a
remotes/origin/manzen
remotes/origin/master
remotes/origin/votes_refactor
shows the "hidden" branches.
Checking them out and making them "visible" is done using (regular) command
udos@X100e:/var/www/mantisbt$ git checkout manzen
Branch manzen set up to track remote branch manzen from origin.
Switched to a new branch 'manzen'
After this, the branch is "visible" again:
udos@X100e:/var/www/mantisbt$ git branch
* manzen
精彩评论