How to update a clone repository without initiate nor tracking?

I found some repository and cloned it to my local hdd with this command

#git clone

Now that repository has a new update, I just want to copy the update to my local HDD. How do I do it? And please don’t say “git fetch/pull”

I search other topics and most advised to do “git init”, then assign a remote name, then “git fetch/pull”. The problem with doing that is I need to initialize git, keep track of names, maintain git service… while I just want to simply update the repository and I don’t use git for any other task but to download repository with the “git clone” command.

Thank you.

Why don’t those work for you? What you’re describing sounds exactly like a case for git pull to be honest. :sweat_smile:

Because I don’t use git as a developer. I also don’t want to overload the system resource with “git init”. I’m a user so the only command I use is “git clone” to copy a repository to the local HDD.

There’s are a few fundamental misunderstandings here:

  1. git init is an extremely cheap operation. It’s not going to overload your system, it just creates the .git repository and a few files in it.
  2. git clone implies git init. What it does is effectively:
    • git init
    • git remote add origin CLONE_URL
    • git fetch origin
    • git checkout on the remote HEAD (generally the default branch), including setting up tracking

If you have cloned a repository and just want to update it to the latest remote state, git pull is exactly the way to go. It’s the official “simply update” command, if you will. What that does is:

  • git fetch
  • Merge the remote tracking branch into the current branch

This is pretty obviously much less work than a full clone. In particular, git fetch will only retrieve objects that are new, so there’s going to be way less network traffic on pull than during a full clone. If you don’t want to pull or fetch as a matter of principle I’m afraid there’s no way to help you here.