Skip to content

Instantly share code, notes, and snippets.

@yrevar
Created March 17, 2016 19:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yrevar/e194e23fef8917bf7236 to your computer and use it in GitHub Desktop.
Save yrevar/e194e23fef8917bf7236 to your computer and use it in GitHub Desktop.
Backup your bashrc on gist with a very simple command. It preserves the gist url and updates the same file you backed up on gist before.
# Target OS: Linux/Mac
# Prerequisites: Make sure you have installed and setup gist (https://github.com/defunkt/gist), and modified bashrc path as per your own setup which in my case was $HOME/.bash_profile.
gist -u $(cat $HOME/.bashrc_gisturl) -c -p -f "my_last_bashrc" -d "`date`" $HOME/.bash_profile > $HOME/.bashrc_gisturl
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment