Skip to content

Instantly share code, notes, and snippets.

@LeoMcA
Created June 7, 2017 07: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 LeoMcA/93d5b631a89296a6e19256c51c0de24c to your computer and use it in GitHub Desktop.
Save LeoMcA/93d5b631a89296a6e19256c51c0de24c to your computer and use it in GitHub Desktop.
Setup git remotes for easy pushing like you're fetching
#!/bin/sh
echo "What should this computer be called?"
read this_name
echo "What should the other computer be called?"
read that_name
echo "What's the hostname of the other computer?"
read that_hostname
echo "What's the path to the respository on this computer?"
read this_path
echo "What's the path to the repository on the other computer?"
read that_path
eval this_path=$this_path
cd $this_path
git remote add $that_name $that_hostname:$that_path
git config remote.$that_name.push "+refs/heads/*:refs/remotes/$this_name/*"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment