Using GitHub for Windows with non-GitHub repositories

github, git 0 comments suggest edit

In my last blog post, I mentioned that GitHub for Windows (GHfW) works with non-GitHub repositories, but I didn’t go into details on how to do that. GHfW is optimized for GitHub.com of course, but using it with non-GitHub repositories is quite easy.

All you need to do is drag and drop the HTTPS clone URL into the dashboard of the application.

For example, suppose you want to work on a project hosted on CodePlex.com. In my case, I’ll choose NuGet. The first thing you need to find is the Clone URL. In CodePlex, click on the Source Code tab and then click on the sidebar Git link to get the remote URL. If there is no Git link, then you are out of luck.

nuget-codeplex-git-url

Next, select the text of the clone url, then click on it and drag it into the GitHub for Windows dashboard. Pretty easy!

ghfw-drag-drop-repo

You’ll see the repository listed in the list of local repositories. Double click the repository (or click on the blue arrow) to navigate to the repository.

ghfw-nuget-local-repo

The first time you navigate to the repository, GHfW prompts you for your credentials to the Git host, in this case, CodePlex.com. This probably goes without saying, but do not enter your GitHub.com credentials here.

ghfw-codeplex-credentials

GHfW will securely store the credentials for this repository so that you only need to enter it once. GHfW acts as a credentials provider for Git so the credentials you enter here will also work with the command line as long as you launch it from the Git Shell shortcut that GHfW installs. That means you won’t have to enter the credentials every time you push or pull commits from the server.

With that, you’re all set. Work on your project, make local commits, and when you’re ready to push your changes to the server, click on the sync button.

ghfw-nuget-sync-codeplex

While we think you’ll have the best experience on GitHub.com, we also think GitHub for Windows is a great client for any Git host.

Tags: git, github, ghfw, gh4w

Found a typo or error? Suggest an edit! If accepted, your contribution is listed automatically here.

Comments

avatar

42 responses

  1. Avatar for James Dunne
    James Dunne May 29th, 2012

    Please, please... please... PLEASE fix the syntax highlighters for C# code hosted on github. They're a joke. Support for ASHX, ASPX, and T4 files would be nice too, but at the very minimum, .cs files should highlight correctly.

  2. Avatar for Craig
    Craig May 30th, 2012

    How do I do a rebase in GH4W ? Something simple like this to rebase my working branch from master
    $ git checkout <mylocalbranch>
    $ git rebase master

  3. Avatar for rasmus christensen
    rasmus christensen May 30th, 2012

    Is there a log somewhere in the client?

  4. Avatar for Peter
    Peter May 30th, 2012

    @James Dunne: I think you can implement that yourself if you really need it. It's probably open and out there.

  5. Avatar for Simon Skov Boisen
    Simon Skov Boisen May 30th, 2012

    @Peter Github for Windows aswell as Github for Mac is closed source. It's possible though that the color-highlightning is using an opensource library that James could contribute to.

  6. Avatar for Simon Skov Boisen
    Simon Skov Boisen May 30th, 2012

    @Rasmus: Check out C:\Users\<username>\AppData\Local\GitHub\TheLog.txt

  7. Avatar for Eric
    Eric May 30th, 2012

    Why is there no visualization of the tree (dag)?

  8. Avatar for Justin
    Justin May 30th, 2012

    I mostly use GitHub but was wondering about that. My laziness paid off...you did the work for me :) Thanks.

  9. Avatar for Shiju Varghese
    Shiju Varghese May 30th, 2012

    This is just awesome! :)

  10. Avatar for Rob
    Rob May 30th, 2012

    ASP.NET MVC Traitor!

  11. Avatar for Scott Blomquist
    Scott Blomquist May 31st, 2012
    we also think GitHub for Windows is a great client for any Git host.


    Not quite _any_ host. I have a repo at work that doesn't support HTTPS access, and probably never will. Is there any chance that GHfW will someday support SSH? If so, then I'll be able to agree with you.
    Otherwise, I'll have to hold out hope that someone else can bring all the goodness of GHfW _and_ SSH support in a single package that's as easy to dive into as your tool is. Keep up the good work!

  12. Avatar for Roman
    Roman May 31st, 2012

    This is awesome tool. Thanks!

  13. Avatar for haacked
    haacked May 31st, 2012

    @James: Please send an email to support@github.com with specifics on what's broken about the C# highlighting. Or better yet, send a pull request to https://github.com/github/linguist if you're really ambitious. :)
    @Craig: we don't support that yet. You can open a Git Shell from the repository view and use the command line.
    @Eric: We chose a simpler linear model to be in line with GitHub.com and GitHub for Mac. However, I've been doing some experimentation with SeeGit. It's something I think about.
    @Scott: We do support repos that use SSH, but only if you use an SSH key without a passphrase. We recognize that's not ideal security wise, but unfortunately, we don't have a way yet to inject ourselves into the process of supplying sshagent a password.

  14. Avatar for Joe
    Joe June 4th, 2012

    G4W is really great. A major step forward. I would prefer to use it over things like hg-git + TortoiseHg, where branching gets... wonky. But unfortunately it doesn't like things such as differing permissions from that stored in the repo. It treats them as remove all text, and readd all text.

  15. Avatar for David Staab
    David Staab June 6th, 2012

    Regarding a view of the DAG: one of the primary reasons to use a DVCS is to have a non-linear rev history. I don't know how I'll be able to use GHFW to manage the branches I create for every public release of my product that coexist simultaneously.
    GHFW seems like a big step forward, but it still needs to provide interfaces for all the features of Git, including a DAG viewer, a log viewer, SSH keygen from the UI, etc. It needs to be competitive with TortoiseSVN in terms of usability and full-featuredness if you want to pull users over to it.

  16. Avatar for Brian Vallelunga
    Brian Vallelunga June 6th, 2012

    This is great, but I'd love it if GH4W could directly clone a non-github repository. Surely it's a simple matter to add in this functionality. Even if it's just over HTTPS, that's fine.

  17. Avatar for Ryan Whitmire
    Ryan Whitmire June 20th, 2012

    Hi Phil, I just started testing out gh4w on our network repositories at work and I absolutely love it. The UX is simple and intuitive. It really reduces the learning curve of git which is great for new hires. So far, I have only one request.
    Being a large team, we pull/merge/push 10-20 times per day and deal with merge conflicts regularly. This makes it difficult for us to ween ourselves off of git extensions with kdiff. With a built-in tool to help us resolve conflicts, I could see our team going all in with gh4w.
    Thanks for the hard work! As a .NET developer, I was very excited when you were hired at GitHub and I am certainly not disappointed with this product.
    -Ryan

  18. Avatar for Ryan Whitmire
    Ryan Whitmire June 20th, 2012

    Oh, and I forgot my other feature idea. If the repository has a .sln file in the root, provide a "Launch Visual Studio" option in the context menu. I would imagine 95% of Windows GitHubbers are using Visual Studio.

  19. Avatar for Dave
    Dave June 21st, 2012

    Phil did you happen to have any influence on this UX? Looks strikingly similar to Metro style...I love it.

  20. Avatar for Jalpesh Vadgama
    Jalpesh Vadgama June 21st, 2012

    Thanks for the tip!!. You guys rock!!

  21. Avatar for haacked
    haacked June 21st, 2012

    @Dave: No, the UI was designed pretty much before I got to GitHub. I worked mostly on the guts of the program.

  22. Avatar for flipdoubt
    flipdoubt June 24th, 2012

    Could you do a post for those of us who must use SVN to sync at work but would like to use GH4W to track changes locally? All of your posts say we have to make a local clone to start using GH4W, but what if I want to create my own repo out of thin air: do I have to drop down to the command line and create a repo from there?

  23. Avatar for haacked
    haacked June 25th, 2012

    @flipdoubt You can click the "+ add" button to create a new repo locally using GitHub for Windows.

  24. Avatar for fde
    fde June 28th, 2012

    May be it's a stupid question here but anyway.
    We have several git-backed and svn-backed projects in our company. Usually we use git svn command to work with whole "zoo" in a standard fashion.
    Is it possible to connect to svn repo from GitHub for Windows?

  25. Avatar for haacked
    haacked June 28th, 2012

    @fde: nope. GHfW only works with git. You'd still need to use git-svn and I'm not even sure that really works well with GHfW as we haven't tried it and don't officially support that.

  26. Avatar for CN
    CN July 4th, 2012

    Do you have a sample of setting up bitbucket as HTTPS using GHfW?

  27. Avatar for William Melvin
    William Melvin August 9th, 2012

    I have been using GHfW for a couple of months and I love it. It does make working with my repos much easier. I do have one issue that comes up periodically regarding self-hosted SSH only Repositories (which is what I have). The issue is that when an update of portable git in installed it uses the default (or overwrites the existing) ...ProtableGit_...\etc\ssh\ssh_config file. The only way that I could get SSH to authenticate me with my repo host was to add an entry to that file for my host that points to my IdentityFile. It is not that big of a deal, since all I have to do is update that one config file following updates to PortableGit. My question is, did I miss something and should those credentials go somewhere else? BTW, I have Putty tools and pageant running, so from the Putty perspective and most other app requiring SSH access to this server the connection is not a problem.
    But like I said at the beginning, even with this minor issue GHfW is a huge leap forward and I appreciate the hard work.
    Thanks,
    William

  28. Avatar for Attila
    Attila January 8th, 2013

    Working but it does not remember my local repository. I am starting with an empty dashboard at every startup

  29. Avatar for Jeremy Schwartz
    Jeremy Schwartz February 7th, 2013

    I found this post - http://blog.stevebumbaugh.c...

    but then this SO was way easier, trick was using `https` vs `ssh` url: http://stackoverflow.com/qu...

  30. Avatar for Alex Leonard
    Alex Leonard May 14th, 2013

    Thanks for this - I tested it out just now with Beanstalk and it worked a charm.

    Much appreciate the clear and simple walkthrough.

  31. Avatar for zA
    zA May 30th, 2013

    Here's an even easier way, http://www.infragistics.com...

  32. Avatar for Omid K. Rad
    Omid K. Rad November 4th, 2013

    I had used this feature before on previous versions of GHFW but this does not work for me as of today. When I drag a repository onto GHFW window, I get the "forbidden" mouse cursor and nothing happens when I drop. I thought maybe that was because of it not running as Administrator. However, there's no place in GHFW properties to run it as Administrator. I tried running it from a console that is running as Admin to no avail. There doesn't seem to be any other option in GHFW for me to enter the path to an existing repository for tracking. Simply can't use this feature.

  33. Avatar for haacked
    haacked November 4th, 2013

    Please send an email to support@github.com and we'll try and get to the bottom of this. This should work.

  34. Avatar for Omid K. Rad
    Omid K. Rad November 4th, 2013

    OK, I think I found the problem. It works when I don't run the app as Administrator. I have a custom console and I have an alias there for running GHFW. The alias is set like:

    doskey github="%APPDATA%\Microsoft\Windows\Start Menu\Programs\GitHub, Inc\GitHub.appref-ms"

    When running GHFW from the console that is running as Administrator then the drag-and-drop feature on GHFW app is disabled, with no informative message or anything other than changing mouse cursor to "forbidden" icon.

  35. Avatar for haacked
    haacked November 4th, 2013

    Ah, that makes sense. Because you're dragging a file from a low-privilege process to a high-privilege process. I bet it would work if you dragged from an explorer instance also running as administrator. :)

  36. Avatar for Jason Judge
    Jason Judge November 12th, 2013

    I tried this with BitBucket and could not get it to work (at first). BitBucket provides the full clone command in a form field, and that would not drag between windows. When I realised that selecting *just* the git: URL in the clone, and then dragging that selected text from the form field to GHfW, it all worked like magic. Very cool.

    I think drag-and-drop is okay for a short-cut, but IMO it needs to back up more basic functionality such as copying a URL into a field. Without this post, I would NEVER have guessed that I could do this, and that feels like we are descending back into the mystery-meat days of the 90s.

  37. Avatar for Laszlo
    Laszlo January 25th, 2014

    Thanks for this. But am I not supposed to be able to use a repo as a remote without it being run as a git server? Why can't GHfW point to a second .git file locally? We would use git on a shared server, with everyone RDPing in — why can't we git on the server without setting up a server? (And in any case, I don't seem to be able to edit the URL for primary (original) remote for my repo, if I want to divert it from GitHub. Why not?)

  38. Avatar for haacked
    haacked January 25th, 2014

    > Why can't GHfW point to a second .git file locally?

    These are all great questions to send to support@github.com. It probably doesn't do these things because not many have asked for it.

  39. Avatar for Nick Laros
    Nick Laros November 15th, 2014

    thanks for the tips :D

  40. Avatar for mmartinovich
    mmartinovich December 11th, 2014

    How can U setup GH4W to sync with local dropbox folder?

  41. Avatar for Stephen Downes
    Stephen Downes January 28th, 2016

    The drag-and-drop works pretty well (once you accept a second or so lag) but there's no way to ever discover this just by playing with the application - why wouldn't there be an optional place to enter the URL in a form somewhere?

  42. Avatar for Anov Siradj
    Anov Siradj May 10th, 2016

    thank you verrryy mucchh