user2087045
user2087045

Reputation: 159

Git clone --no-checkout again

I don't want to waste space on my machine and I only want to see the history of repository (for each branch). That's why, I did a:

    git clone --no-checkout

After I did this, somebody pushed something. I have to do something to be again with the history updated, but I don't know what. Of course, I can use git checkout & git pull, but I don't need the files, I need only the .git folder to be updated. I tried with git fetch, but it seems the history is not updated.

Upvotes: 15

Views: 29708

Answers (1)

user3159253
user3159253

Reputation: 17455

Use --bare option for git clone

Update:

after the cloning is completed make sure that the section remote.origin in the configuration (see config file in the repo) contains fetch key with an appropriate. The section should look like this:

[remote "origin"]
    url = <upstream repo remote address>
    fetch = +refs/heads/*:refs/remotes/origin/*

Then you may update the repo from time to time by issuing git fetch inside the repo.

Upvotes: 13

Related Questions