
#GIT FETCH VS PULL UPDATE#
In the latter case we want to immediately issue an update of the ref before creating a pipeline. update only refs/pull/123/head - This would be useful when updating only the refs that changed as part of the mirror update but also when a pull request is opened and a webhook is sent to GitLab about it. Update specific refs/pull/N/head to mirror repository.Find all remote refs/pull/*/head - Like we currently do for branches to know which one has changed and update only those that changed.For this purpose we might need 2 separate endpoints: This option controls whether git fetch (and the underlying fetch in git pull) will recursively fetch into populated submodules. In order to support fork workflows we would need to make refs/pull/*/head refs available in the mirror repository. In Projects::UpdateMirrorService we update tags, branches and LFS objects. However, with fork workflows it does not work because the pull request source_sha would not exist in the mirror repository. Pull is used to update your current HEAD branch with the latest changes from the. This works fine when a pull request is opened from the same repository. Pull Fetch downloads only new data from a remote repository.

This is a Gitlab CI/CD for external repo that is set up using GitHub integration. In that case, it does prune the remote tracking branches (from /remotes/anUpstreamRepo/ ), but it didn't say what upstream repo was the cause of said pruning. In we are working on detecting when a branch push occurs in the context of a GitHub pull request so that we run a pipeline for ExternalPullRequest object. The other answers explain what git fetch -prune does, but there is one case where it needs to be a bit more precise: when the there is nothing to fetch (no new refs) from the upstream repo.
