GitLab: Tracking changes in master.

Hi,

I have forked the upstream CMake repository into a personal account and created a branch into which I committed stuff (following CONTRIBUTING.rst)

In the meantime, the upstream master has changed, but my forked project (and therefore my branch) doesn’t get the additional commits. I would like to rebase my branch onto the current upstream master, but Git always tells me “everything up to date”. Obviously, I have done something wrong here when setting up the branch.

How do I correctly track the upstream master?

Assuming you’re in the default branch of the repo that you forked:

git remote add upstream https://gitlab.kitware.com/cmake/cmake  # one time

git fetch upstream
git rebase upstream/master

Personally, I had created the following alias in my ~/.gitconfig file:

[alias]
	# sync local branch with upstream
	sync = "!head=$(git head) && git fetch upstream && git rebase upstream/$head"

So, to synchronize, I do the following:

> git checkout master
> git sync
> git push

The last command to re-synchronize your personal remote master branch

1 Like

@scivision, @marc.chevrier It worked. Thanks alot! :+1: