I've created GitLab project by cloning remote repository. During a few days my colleagues pushed their commits to the original repository (not GitLab). Now I did 'git fetch --all' from GitLab repository but commits do not show in GitLab web UI. What should I do to resync GitLab project with its repository? Is there rake task for that? I can't simply recreate the project as we already imported issues from an external source, created labels, milestones, etc.
The short answer is: you cannot pull a specific commit from a remote. However, you may fetch new data from the remote and then use git-checkout COMMIT_ID to view the code at the COMMIT_ID .
To push the commit from the local repo to your remote repositories, run git push -u remote-name branch-name where remote-name is the nickname the local repo uses for the remote repositories and branch-name is the name of the branch to push to the repository. You only have to use the -u option the first time you push.
There is no GitLab feature to fetch the upstream updates. What you did was import an already existing repository, and that is a one time feature.
But you can fetch the upstream updates into your local repository, then push them to GitLab. You'll need to add the orginial/upstream repo as a remote to your local repository by running git remote add upstream {path to original repo}
, then fetch the upstream repos by running git fetch upstream
, then merge git merge upstream/master
, then git push master origin
.
GitHub has a decent help section on adding the upstream remote, and doing the merge.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With