Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git clone --no-checkout again

Tags:

git

git-clone

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.

like image 541
user2087045 Avatar asked Oct 13 '15 13:10

user2087045


1 Answers

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.

like image 149
user3159253 Avatar answered Sep 28 '22 02:09

user3159253