2

I want to push github without typing username and pass every time.

Using Ubuntu terminal, git asks me every time my user name and pass, when I pushing in MacOS, it did not happen. I am setting correct global setting below.

git config --global user.name "username" git config --global user.email "[email protected]" 

Saw this, (Why Git is not allowing me to commit even after configuration?) and tried

git config --unset --local user.name git config --unset --local user.email 

but nothing happened.... Please help me.

[core] repositoryformatversion = 0 filemode = true bare = false logallrefupdates = true [remote "origin"] url = https://github.com/username/sh fetch = +refs/heads/*:refs/remotes/origin/* [branch "master"] remote = origin merge = refs/heads/master 
1
  • user.name and user.email have nothing whatsoever to do with authentication. Those settings are just or authoring information. Commented Jun 29, 2019 at 16:57

2 Answers 2

1

You have setup your git repository using the https protocol:

[remote "origin"] url = https://github.com/kaede0902/sh 

The https protocol requires you to enter your username and password every time. You need to use the ssh protocol. For that, you need to create SSH keys first. I would recommend this guide: https://www.testingexcellence.com/install-git-mac-generate-ssh-keys/ . For your use case, when running ssh-keygen -t rsa, do not enter a passphrase.

Then, once that's done, either go to your local repository and execute the following command:

git remote set-url origin [email protected]:kaede0902/sh.git 

Or re-clone your repository somewhere else using the following command:

git clone [email protected]:kaede0902/sh.git 
Sign up to request clarification or add additional context in comments.

2 Comments

I remembered I made ssh key in the first PC! Thank you!!! But My blog reposity in Macbook, It seems to be being used https because ` url = github.com/kaede0902/blog` is written in /blog/.git/config
I could do this. used SSH. without pass and username
1

You need to set up an SSH key for GitHub. See How to connect to GitHub with SSH

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.