Site Overlay

Git Rebase or how to reconcile your local repository with a remote repository

Sometimes when starting a new project, there is no time to go to the remote Git server to create the repository first there then clone it to your local machine.

Instead, it may be more convenient to start with git init and connect to the remote repository later.

When creating the remote repository to upload your work, it is possible you add some defaults as LICENSE and README. If your local repository does not have these changes, trying to PUSH your branch will end up in an error, with some general suggestion that you need a method to reconcile your branches.

Something you can do is fetch, then rebase origin <> master.

All you need to do is:

git fetch
git rebase origin/master

After that then you’ll see the files that were created in your remote repository are now merged with the master branch in your local repository.

Now you can finally push:

git push origin master

Leave a Reply

Your email address will not be published. Required fields are marked *