Skip to content

Transfer a gist to a GitHub repository

6. May 2014

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

That’s it!!!

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
Advertisements
Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: