oe7drt-website/content/posts/2020/11-keep-up-to-date-on-forked-repositories/index.md
Dominic Reich e8393d95a3
update posts aliases; fix some dates; fix some typography
- post aliases instead of redirects
 - some dates were wrong, fixed and create multiple aliases to not brake the old date
 - fix some typography like newlines on end of file
2023-11-18 23:01:27 +01:00

29 lines
987 B
Markdown

---
title: Keep up-to-date on forked repositories
aliases: /posts/2020-11-14-keep-up-to-date-on-forked-repositories
categories: [computerstuff]
tags: [git]
date: 2020-11-14T23:20:16+01:00
---
I usually fetch the upstream repository and merge it into my local repository,
then upload all the merges into the github repository. That works sometimes,
but it also fails sometimes with me having an extra commit with merges leaving
the git history different from the upstream...
<!--more-->
This snippet has been taken from [github.community][1].
[1]: https://github.community/t/update-a-forked-repository-when-the-original-repository-is-updated/1855/3
```console
$ git checkout master # Make sure you always run the following commands from the master branch
$ git fetch --all
$ git pull --rebase upstream master
$ git push origin master
```
> This will rebase the upstream changes on your local forked version so the
> master branch git history will look exactly the same at the end.