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?

5
  • 2
    Git itself does not do this. You may have something else configured to run git fetch automatically at regular intervals, though. Commented Aug 27, 2021 at 21:20
  • 2
    Does this answer your question? Git: automatic fetching from remote repositories? Commented Aug 27, 2021 at 21:20
  • @chepner how can I check whether it is configured to run automatically? Commented Aug 27, 2021 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. Commented Aug 28, 2021 at 2: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. Commented Aug 28, 2021 at 12:22

1 Answer 1

1

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.