Git error: “Please make sure you have the correct access rights and the repository exists”

后端 未结 27 925
面向向阳花
面向向阳花 2020-12-12 14:49

I am using TortoiseGit on Windows. When I am trying to Clone from the context menu of the standard Windows Explorer, I get this error:

Please make sur

27条回答
  •  攒了一身酷
    2020-12-12 15:05

    I come across this error while uploading project to gitlab. I didn't clone from git but instead upload project. For pushing your code to gitlab you have two ways either using ssh or https. If you use https you have to enter username and password of gitlab account. For pushing you code to git you can use following one.

    Pushing to Git for the first time

    >$ cd
    >$ mkdir .ssh;cd .ssh
    >$ ssh-keygen -o -t rsa -b 4096 -C "email@example.com"
    

    The -C parameter is optional, it provides a comment at the end of your key to distinguish it from others if you have multiple. This will create id_rsa (your private key) and id_rsa.pub (your public key). We pass our public key around and keep our private key — well, private. Gitlab’s User Settings is where you would then add your public key to your account, allowing us to finally push.

    In your project location(Directory) use below command

    git init
    

    It Transform the current directory into a Git repository. This adds a .git subdirectory to the current directory and makes it possible to start recording revisions of the project.

    Push Using https path

    git push --set-upstream https://gitlab.com/Account_User_Name/Your_Project_Name.git master
    

    Push Using ssh path

    git push --set-upstream git@gitlab.com:Account_User_Name/Your_project_Name.git master
    

    — set-upstream: tells git the path to origin. If Git has previously pushed on your current branch, it will remember where origin is

    master: this is the name of the branch I want to push to when initializing

提交回复
热议问题