Bennett Hollstein

Web developer

Use GitHub Desktop (for Mac) for every Git Repository

Hello,

when using GitHub Desktop you can only use GitHub Repositories by default, but with a little help of the command line it is possible to use any Git Repository (self-hosted, BitBucket, GitLab etc.).

Please notice that I am using a Mac, GitHub Desktop for Mac and the default Mac Terminal. Commands or button layouts may vary on other OSses. You will need some basic understanding of the Command Line for this Tutorial.

Cloning repository

Firstly you’ll need to clone your desired repository with the Terminal.

Open the Terminal by pressing ⌘ + SPACE and typing Terminal.

Then, change your directory in Terminal to the Folder you want your Repository to be cloned to (git will automatically create a sub-folder for your repository)

cd /path/to/my/folder

(You can drag a folder into the Terminal window to automatically add the full path to it).

Then clone your repository

git clone git://mygit.hoster/repository.git

You may need to install the command line tools or just the git CLI in order for this to work.

Importing your repository into GitHub Desktop

You can now click on the + in GitHub Desktop (on the top right) and click Add. The navigate to the folder to which you have cloned the repository, click on the folder with your repositories name and add it to GitHub Desktop.

Changing credentials

You may need to change your credentials of GitHub Desktop to what your Repository hoster expects.

In the menu bar click on GitHub Desktop > Preferences or use ⌘ + ,, then go to Advanced and edit the Git Config to your needs.

 

You should now be able to use the repository in your GitHub Desktop App.

Kommentar verfassen