- I forked a repo on GitLab
- Cloned my fork to my local machine
- Made some changes, then pushed to my fork.
- Some changes have been made on the original repo and I want to
git pullso everything is up to date.
Is this possible?
I've tried git pull and git pull origin master and got everything is up-to-date. (makes sense)
git pull upstream gave me the following message:
You asked to pull from the remote 'upstream', but did not specify a branch.
I don't know how to specify these branches, everything thing i've tried returns branch does not exist. But I feel this is the right direction..
Branches:
* master
remotes/origin/HEAD -> origin/master
remotes/origin/master
I'm not sure the difference between these two branches. Or which one is the original repo to begin. I'm all out of git pull ideas and feel there might be something else I'm missing?
Method 1
Handle merge conflicts if any.
Commit the merge and push to master
Method 2 1. Go the root directory of project. 2. Fetch the branches and their respective commits from the upstream repository. Commits to master will be stored in a local branch, upstream/master.
4.Merge the changes from upstream/master into your local master branch. This brings your fork's master branch into sync with the upstream repository, without losing your local changes.