Git push requires username and password

前端 未结 24 2095
灰色年华
灰色年华 2020-11-22 04:14

I cloned a Git repository from my GitHub account to my PC.

I want to work with both my PC and laptop, but with one GitHub account.

When I try to push to or p

24条回答
  •  后悔当初
    2020-11-22 04:27

    If you have cloned HTTPS instead of SSH and facing issue with username and password prompt on pull, push and fetch. You can solve this problem simply for UBUNTU

    Step 1: move to root directory

    cd ~/
    

    create a file .git-credentials

    Add this content to that file with you usename password and githosting URL

    https://user:pass@example.com
    

    Then execute the command

    git config --global credential.helper store
    

    Now you will be able to pull push and fetch all details from your repo without any hassle.

提交回复
热议问题