Transfer a gist to a GitHub repository
Today, I had to manage the task of transfering data, that I previously managed in a gist, to a GitGub repository!
As this was pretty easy…I’d like to share the code with you!
Here’s the source: http://stackoverflow.com/a/13671484
1. Initialise a new, empty repository “GistOnGitHub” on GitHub
2. Add a new remote “github” and push the content to the repository
git remote add github https://github.com/username/GistOnGitHub.git git push -u github master
3. Change the name of the origin of the gist to “gist”
git remote rename origin gist
4. Check out if you’ve typed in everything correctly
git remote -v
From now on…you can push your data to the GitHub-gist and the GitHub-repository, by using:
git push github master git push gist master
P.S.: I had some problems:
- with the authentication…so I had to redefine the ssh-authentication!
- used the wrong URL of the source description and had to change the new remote to the correct URL
git remote set-url github https://github.com/username/GistOnGitHub.git