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 "my@email.com"

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
Nisala
  • 1,313
  • 1
  • 16
  • 30
KAEDE
  • 340
  • 3
  • 10

2 Answers2

1

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

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 git@github.com:kaede0902/sh.git

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

git clone git@github.com:kaede0902/sh.git
Cydrick Trudel
  • 9,957
  • 8
  • 41
  • 63
  • 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 = https://github.com/kaede0902/blog` is written in /blog/.git/config – KAEDE Jun 29 '19 at 16:35
  • I could do this. used SSH. without pass and username – KAEDE Aug 04 '19 at 11:05