Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save cvega/63cd20c2b9ca655a1f7f4899004a28aa to your computer and use it in GitHub Desktop.

Select an option

Save cvega/63cd20c2b9ca655a1f7f4899004a28aa to your computer and use it in GitHub Desktop.

Revisions

  1. @joncardasis joncardasis revised this gist Aug 11, 2016. 1 changed file with 8 additions and 3 deletions.
    11 changes: 8 additions & 3 deletions Storing-Images-On-Github.md
    Original file line number Diff line number Diff line change
    @@ -2,19 +2,24 @@
    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.

    ## How to
    #### 1. Create a new branch
    #### 1. Clone a fresh copy of your repo
    In order to prevent any loss of work it is best to clone the repo in a separate location to complete this task.

    #### 2. Create a new branch
    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.

    #### 2. Remove files from the working tree
    #### 3. Remove files from the working tree
    `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.

    #### 3. Add your images and screenshots and commit the change
    #### 4. Add your images and screenshots and commit the change
    `git add screenshot.png demo.gif logo.png`

    `git commit -m "Added Assets"`
  2. @joncardasis joncardasis revised this gist Jul 28, 2016. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions Storing-Images-On-Github.md
    Original file line number Diff line number Diff line change
    @@ -22,6 +22,7 @@ You can also check what branch you are on anytime by using `git branch`. The bra
    #### 4. Finally push your changes
    `git push origin assets`


    ## Use the images in your README
    You can now use
    `![Demo Animation](../assets/demo.gif?raw=true)`
  3. @joncardasis joncardasis revised this gist Jul 28, 2016. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion Storing-Images-On-Github.md
    Original file line number Diff line number Diff line change
    @@ -22,7 +22,7 @@ You can also check what branch you are on anytime by using `git branch`. The bra
    #### 4. Finally push your changes
    `git push origin assets`


    ## Use the images in your README
    You can now use
    `![Demo Animation](../assets/demo.gif?raw=true)`
    in your README to have the gif display on your master's readme.
  4. @joncardasis joncardasis created this gist Jul 28, 2016.
    29 changes: 29 additions & 0 deletions Storing-Images-On-Github.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,29 @@
    # Storing Images and Demos in your Repo
    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.

    ## How to
    #### 1. Create a new branch
    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.

    #### 2. Remove files from the working tree
    `git rm -rf .`

    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.

    #### 3. Add your images and screenshots and commit the change
    `git add screenshot.png demo.gif logo.png`

    `git commit -m "Added Assets"`

    #### 4. Finally push your changes
    `git push origin assets`


    You can now use
    `![Demo Animation](../assets/demo.gif?raw=true)`
    in your README to have the gif display on your master's readme.