1

I have a question about git fetch.
Actually, I know how it works.

But I guess without that command, I can see the changes from origin/<branch>.
Lets say in GitHub repo, some files get changed and I can simply see them on my machine by doing git checkout origin/<branch> without git fetch origin/<branch> command.

Is it a new feature by git?
Automatically fetching remote repo?

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
Alish Safarli
  • 55
  • 1
  • 7
  • 2
    Git itself does not do this. You may have something else configured to run `git fetch` automatically at regular intervals, though. – chepner Aug 27 '21 at 21:20
  • 2
    Does this answer your question? [Git: automatic fetching from remote repositories?](https://stackoverflow.com/questions/10464039/git-automatic-fetching-from-remote-repositories) – Jeff Bowman Aug 27 '21 at 21:20
  • @chepner how can I check whether it is configured to run automatically? – Alish Safarli Aug 27 '21 at 21:23
  • It's not something Git itself knows about. Maybe there's a cron job; maybe it's your IDE. There's no one place you can go to check. – chepner Aug 28 '21 at 02:24
  • There *is* a project to add background fetching (via `git maintenance`) to Git, but it's not something that most people should be using yet and it's not enabled by default. I used to run some systems with mirrors that would auto-fetch regularly (5 and 15 minutes intervals, and 1 hour intervals) for internal corporate repositories, but that's rather different usage. We wrote all our own scripts to do this. – torek Aug 28 '21 at 12:22

1 Answers1

0

This is generally due to an IDE like VSCode, which will fetch on a regular basis.

Check the git.autofetch setting.

But as commented, outside of a third-party tool doing the fetching, git alone would not.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250