You have to add the original repository (the one you forked) as a remote.
From the GitHub documentation on forking a repository:
Once the clone is complete your repo will have a remote named “origin
” that points to your fork on GitHub.
Don’t let the name confuse you, this does not point to the original repo you forked from. To help you keep track of that repo we will add another remote named “upstream”:
$ cd PROJECT_NAME
$ git remote add upstream https://github.com/ORIGINAL_OWNER/ORIGINAL_REPOSITORY.git
$ git fetch upstream
# then: (like "git pull" which is fetch + merge)
$ git merge upstream/master master
# or, better, replay your local work on top of the fetched branch
# like a "git pull --rebase"
$ git rebase upstream/master
There's also a command-line tool (hub
) which can facilitate the operations above.
Here's a visual of how it works:
See also "Are Git forks actually Git clones?".
Add a url to video file in your ReadMe.
Github now supports videos, see more detailed answer here: https://stackoverflow.com/a/4279746/1092815
You can see a live example here (See at the end of the readme):
https://github.com/alelievr/Mixture/blob/0.4.0/README.md
Github Pages
I strongly recommend placing the video in a project website created with GitHub Pages instead of the readme, like described in VonC's answer; it will be a lot better than any of these ideas. But if you need a quick fix just like I needed, here are some suggestions.
Use a gif
See aloisdg's answer, result is awesome, gifs are rendered on github's readme ;)
Use a video player picture
You could trick the user into thinking the video is on the readme page with a picture. It sounds like an ad trick, it's not perfect, but it works and it's funny ;).
Example:
[![Watch the video](https://i.imgur.com/vKb2F1B.png)](https://youtu.be/vt5fpE0bzSY)
Result:
Use youtube's preview picture
You can also use the picture generated by youtube for your video.
For youtube urls in the form of:
https://www.youtube.com/watch?v=<VIDEO ID>
https://youtu.be/<VIDEO URL>
The preview urls are in the form of:
https://img.youtube.com/vi/<VIDEO ID>/maxresdefault.jpg
https://img.youtube.com/vi/<VIDEO ID>/hqdefault.jpg
Example:
[![Watch the video](https://img.youtube.com/vi/T-D1KVIuvjA/maxresdefault.jpg)](https://youtu.be/T-D1KVIuvjA)
Result:
Use asciinema
If your use case is something that runs in a terminal, asciinema lets you record a terminal session and has nice markdown embedding.
Hit share button and copy the markdown snippet.
Example:
[![asciicast](https://asciinema.org/a/113463.png)](https://asciinema.org/a/113463)
Result:
Best Answer
Interpreting newlines as
<br />
used to be a feature of Github-flavored markdown, but the most recent help document no longer lists this feature.Fortunately, you can do it manually. The easiest way is to ensure that each line ends with two spaces. So, change
into
(where
_
is a blank space).Or, you can add explicit
<br />
tags.