1

I'm using GitHub Desktop to work with repos in Atlassian Stash. For publishing my own repos, I:

  1. Create a new empty repo in Stash
  2. Add my local directory in GitHub Desktop
  3. Set its origin to my Stash URL (under Repository > Repository Settings...)
  4. Publish

This works fine.

However, sometimes I simply want to clone existing Stash repos to my local machine. GitHub Desktop has a Clone option, of course, but it only works directly with your GitHub.com account; you can't enter an arbitrary URL to clone from. So instead, I thought I would be able to follow a procedure similar to what I use for publishing:

  1. Add a local empty directory
  2. Set its origin to the Stash URL
  3. Pull

But when I do this, I always get a "failed to get HEAD" error.

Why can't I simply pull a Stash repo locally?

daGUY
  • 27,055
  • 29
  • 75
  • 119

1 Answers1

1

You cannot pull in an empty (non-git) repo.

You can simply clone the Stash repo:

cd /path/to/repos
git clone /url/stash/myrepo
cd myrepo
git log

Then you have a local folder /path/to/repos/myrepos, that you can use in GitHub Desktop (Step 2 and 3 of your first procedure).

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • Ah, right. But so I have to clone from the command line then? There doesn't appear to be a way to clone from an arbitrary (non-GitHub) URL within GitHub Desktop. – daGUY Aug 25 '15 at 21:19
  • Exactly: this is one of those cases where you need to fall back to the command line and clone manually. – VonC Aug 25 '15 at 21:28