Search code examples
gitclonelocalhistory

Do I need to do a Git Clone?


My organization has 100s of Git repos. I like to keep my local clones up to date, so I'd like to know which ones need to be cloned instead of re-cloning everything which takes a lot of time. Is there a command that can tell me the last time a remote repo had an update? On any branch?

I've looked into performing a log query on the remote Git repos, but that doesn't appear to be possible


Solution

  • Agree with yorammi and Code-apprentice, +1 to both. So just to expand a little...

    git fetch will update your local repo with any changes from the remote - but will not merge them.

    Then you can use git status to see if there are any changes to merge in.

    Then you can do a git merge to merge them in.

    OR

    git pull does a fetch and a merge, if you don't want to bother doing the checks