0

I have main repository and a forked repository.

I'm writing a gitlab-ci pipeline for the forked repository, and wanted to know if there's a way to check if the repository is synced with the main?

I don't want to pull changes, just check if there are changes to pull. So in case the forked is not synced I will fail the job.

I'm aware of git remote commands or git status -uno but did not find anything that fits.

Please advise.

David Faizulaev
  • 4,651
  • 21
  • 74
  • 124
  • https://stackoverflow.com/q/3258243/7976758 – phd Dec 20 '21 at 20:17
  • 1
    (1) add a remote for the other repository; (2) run `git fetch` or `git ls-remote` using the added remote; (3) compare hash IDs to see if you're in sync. This gets you your answer about whether you're in sync. – torek Dec 21 '21 at 08:22

0 Answers0