Take the 2-minute tour ×
Web Applications Stack Exchange is a question and answer site for power users of web applications. It's 100% free, no registration required.

I've been using GitHub's gist feature for some very lightweight HTML + CSS + JavaScript experiments.

I don't have git on my laptop either as a commandline tool or via some IDE. (I'm hitchhiking around the world with a little netbook.)

Copying and pasting from my favourite text editor to/from Git works just fine.

I also have a proper GitHub account where I have forked some projects, edited little fixes right in the GitHub online editor and issues pull requests upstream. So far for the kind of stuff I'm doing the online tools or GitHub are fine without a commandline or IDE.

But now I'm wondering is there a way to "promote" something which is currently a gist into a full-fledged GitHub project?

share|improve this question

migrated from stackoverflow.com Sep 9 '12 at 11:57

This question came from our site for professional and enthusiast programmers.

add comment

2 Answers 2

up vote 5 down vote accepted

There is no way to do this without the command line. GitHub does not have a way to promote gists into a repo.

While the GitHub interface does allow you to edit files in your repository, they have to already be there via a git push from your local.

Should they add the ability to add files via the web interface then you would be able to "promote" a gist into a GitHub repo via a standard copy and paste of its contents. But that would also not carry over any of the gist's history of commits.

If you still want to, you'll have to use the command line or IDE.

  1. Head to your gist and look for the Public/Private Clone URL
  2. Click it.

    You'll see a pop up with info such as this:

    Use this clone URL yourself.
    git clone git@gist.github.com:{SHA-1}.git local-repo

  3. Run the git clone to your local

    You may be required to confirm the download if the authenticity of the host, gist.github.com, cannot be established.

    You may also have to enter your passphrase to connect to GitHub

  4. Update the remote to your GitHub repo, of where you want to push these files.

    git remote set-url origin {git://new.url.here}
    

Now you should be able to push the gist files into a GitHub repo, with all their commit revision history.

share|improve this answer
    
Hmm would such a "copy paste promotion" leave a continuous repo or fork or would it just start a new one that internally knew nothing of its origins? –  hippietrail Sep 15 '12 at 11:56
    
The latter, just a fresh copy with no history –  Eight Days of Malaise Sep 15 '12 at 12:08
    
Hmm that's too bad, but with the commandline it would preserve the history, do I understand correctly? –  hippietrail Sep 15 '12 at 12:15
1  
Sorry, no. All seen as fresh files, zero history. Doesn't matter if via the web interface or the command line. –  Eight Days of Malaise Sep 15 '12 at 12:18
1  
Sounds like a good idea to send over to GitHub as a feature request –  Eight Days of Malaise Sep 15 '12 at 12:53
show 1 more comment

Well, gists are repositories in their own right - you can clone them, they have history.

Can you just create a repository on github, clone your gist, add the github repository as a new remote, then push to it? It should now contain your gist contents including revision history.

Pretty sure this would require the commandline or some other UI tool that lets you do specific git operations like adding remotes, pulling, and pushing, though.

share|improve this answer
1  
Tested this and it sure enough works if you can use the command line –  Eight Days of Malaise Sep 15 '12 at 23:54
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.