Clone repository
- Create a repository (don't need to follow remote name, use any name).
- Add remote to the repository settings. (Mac: Repository > Repository Settings; Win: "Gear icon" > "Repository Settings" > "Remote"; USE HTTP/HTTPS ADDRESS. Because SSH authentication requires you use command line for once. I mentioned in the third part of this answer.)
- Permanently delete the repository folder!
- (For Mac GitHub Desktop only) Click
Publish
once on the upper-right corner. This will not change the remote repository at all FOR NOW. This behavior may change in the later release of GitHub Desktop. This step is crucial because otherwise, you won't be able to see the Clone Again
option in step 5. But Windows users do not need to do this.
- Go back to GitHub Desktop, Click
Clone Again
. It will prompt you to type login information.
- That's it. Enjoy Git, GitHub Desktop, Gogs!
(Please make sure you type the login information CORRECTLY if you want to click remember password
so that you don't need to type it again and again. Because I happened to type it wrongly on Mac for the second test, and I have not found a place to change that. So I guess I need to re-install GitHub Desktop to correct it. I may be also going to write to GitHub for an answer. Will update this section if I get an answer. But as long as you type it correctly, it works perfectly.)
Tested on
Mac OS 10.10; GitHub Desktop, Deer Types (222), Latest version as of writing.
Win 10 Enterprise; GitHub Desktop, Chocolate-Covered Yaks (3.3.3.0) bc4735a, Latest version as of writing.
This step is for people who would like to use SSH connection. Requires the usage of command line, but it's once for all. (This step is what I think one must do if s/he is going to use SSH connection.)
Add SSH Key
For Mac:
Open GitHub Desktop, Press Command+T
( Or click "Repository>Open in Terminal")
Type: cat ~/.ssh/id_rsa.pub
and press enter
Copy paste the output to your Gogs SSH Keys List.
One may have a different name for id_rsa.pub
. (Seems there is an order for the keys that GitHub Desktop use to connect to remote server. I tried to use github's public key, failed. I didn't spend much time to figure out it. Just use id_rsa.pub
.)
For Win:
Pretty much the same. But open the terminal by clicking the "Gear icon" on the top-right corner
> open in Git Shell
. Copy paste the ~/.ssh/github_rsa.pub
file content instead.