Git clone --no-checkout again

I do not want to waste space on my machine, and I want to see the history of the repository (for each branch). This is why I did:

git clone --no-checkout 

After that, someone pushed something. I have to do something to update the story again, but I don’t know what. Of course, I can use git checkout and git pull, but I do not need files, I only need to update the .git folder. I tried with git fetch, but it seems the story is not updating.

+5
source share
1 answer

Use the --bare for git clone

Update

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

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

Then you can update the repo from time to time by unloading git fetch inside the repo.

+2
source

Source: https://habr.com/ru/post/1233620/


All Articles