Git User Group

cancel
Showing results for 
Search instead for 
Did you mean: 

Fork git setup

Solved!
Go to solution

Hi,

I have set up GitLab remote repository and use Fork as my git client; which I have managed to get working. but every time I push to the remote repo it prompts for username & password. I tried one common solution of saving the SSH key on GitLab which was generated in Fork. But it doesn't work. 
I guess I have to add the GitLab account to Fork. I have generated the personal access token from GitLab correctly, but it throws an authentication failure error (Please see screenshot below)

 

I even tried with another client - SourceTree. It doesn't allow me to add the account either. I have followed the step by step guide here How to Access GitLab via SourceTree (UPDATED) - A Word From Net. Still at the place where I enter credentials, it throws an error stating authentication failure.

 

I'd appreciate if someone can advise.

 

Asa77_0-1658624199825.png

 

0 Kudos
Message 1 of 4
(2,073 Views)

Are you able to 'fetch' from GitLab without error? If only the push operation is unsuccessful, you may wish to check the git remote URL settings. From a command line (PowerShell or Command, it doesn't matter as long as you have Git installed), in the repo folder, enter:

git remote -v

 

The command output should be something like:

origin git@gitlab.com:indriyani/mygitlabproject.git (fetch)
origin git@gitlab.com:indriyani/mygitlabproject.git (push)

 

Note that both (fetch) and (push) URLs are the same. In my case, I used SSH above (URLs begin with git@gitlab.com). The SSH approach does not require the use of Personal Access Tokens, just the proper registration of the public key in your GitLab SSH settings. On the other hand, if you are using HTTPS URLs, then the SSH keys won't matter. In that latter case, your personal access tokens would come into play.

0 Kudos
Message 2 of 4
(2,029 Views)
Solution
Accepted by Asa77

I've seen issues using the built-in SSH generation in Fork and Sourcetree.  For some reason these have been inconsistent.  I use the manual method of creating the key pair and adding the public key to Gitlab and have had no further issues.  I personally use the git-bash terminal emulator for all of this.

 

https://docs.gitlab.com/ee/user/ssh.html

 

I also second Dhakkan in checking that the remote URL is formatted correctly for both fetch and pull.  

0 Kudos
Message 3 of 4
(2,016 Views)

@r_good wrote:

I've seen issues using the built-in SSH generation in Fork and Sourcetree.  For some reason these have been inconsistent.  I use the manual method of creating the key pair and adding the public key to Gitlab and have had no further issues.  I personally use the git-bash terminal emulator for all of this.

 

https://docs.gitlab.com/ee/user/ssh.html

 

I also second Dhakkan in checking that the remote URL is formatted correctly for both fetch and pull.  


Just follow the directions from Gitlab and use Git Bash. Haven't had any issues with that.

Sam Taggart
CLA, CPI, CTD, LabVIEW Champion
DQMH Trusted Advisor
Read about my thoughts on Software Development at sasworkshops.com/blog
GCentral
0 Kudos
Message 4 of 4
(2,012 Views)