In this quick walkthough you'll learn how to create a separate branch in your repo to house your screenshots and demo gifs for use in your master's readme.
In order to prevent any loss of work it is best to clone the repo in a separate location to complete this task.
Create a new branch in your repo by using
git checkout --orphan assets
This will create and switch you to a new branch called "assets". The
--orphan flag creates a new branch but without any prior commits. However it does still keep the working tree and index.
git rm -rf .
THIS WILL DELETE ALL FILES THAT THE WORKING TREE RECOGNIZES Any files that were not added to the tree will remain left behind in the folder.
We remove all files from the working tree since we do not want anything but our screenshots and images in this branch.
You can also check what branch you are on anytime by using
git branch. The branch with the
* next to it is the current branch.
git add screenshot.png demo.gif logo.png
git commit -m "Added Assets"
git push origin assets
You can now use
in your README to have the gif display on your master's readme.