Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8132999
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T09:28:55+00:00 2026-06-06T09:28:55+00:00

These days when I create a new repository on GitHub on the setup page

  • 0

These days when I create a new repository on GitHub on the setup page I get:

git remote add origin https://github.com/nikhilbhardwaj/abc.git
git push -u origin master

And whenever I have to push a commit I need to enter my GitHub username and password.

I can manually change that to

git@github.com:nikhilbhardwaj/abc.git

in the .git/config. I find this quite irritating – is there some way I can configure git to use SSH by default?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T09:28:56+00:00Added an answer on June 6, 2026 at 9:28 am

    Set up a repository’s origin branch to be SSH

    The GitHub repository setup page is just a suggested list of commands (and GitHub now suggests using the HTTPS protocol). Unless you have administrative access to GitHub’s site, I don’t know of any way to change their suggested commands.

    If you’d rather use the SSH protocol, simply add a remote branch like so (i.e. use this command in place of GitHub’s suggested command). To modify an existing branch, see the next section.

    $ git remote add origin git@github.com:nikhilbhardwaj/abc.git
    

    Modify a pre-existing repository

    As you already know, to switch a pre-existing repository to use SSH instead of HTTPS, you can change the remote url within your .git/config file.

    [remote "origin"]
        fetch = +refs/heads/*:refs/remotes/origin/*
        -url = https://github.com/nikhilbhardwaj/abc.git
        +url = git@github.com:nikhilbhardwaj/abc.git
    

    A shortcut is to use the set-url command:

    $ git remote set-url origin git@github.com:nikhilbhardwaj/abc.git
    

    More information about the SSH-HTTPS switch

    • “Why is Git always asking for my password?” – GitHub help page.
    • GitHub’s switch to Smart HTTP – relevant StackOverflow question
    • Credential Caching for Wrist-Friendly Git Usage – GitHub blog post about HTTPS, and how to avoid re-entering your password
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I tend to get surprised these days, but this little bugger really owned me
These days I design some algorithms in python, but find first two greatest value
These days, we encountered a strange problem, some of our solr apps on tomcat
These days web addresses can also include non-ASCII characters. So every modern browser and
These days I'm working on a VB.NET application which can be used to edit,
These days I come across several Google search results that contain sites with links
I'm studying javascript these days and I have question. I have variable that contain
Like most web developers these days, I'm thoroughly enjoying the benefits of solid MVC
Web-Applications these days make extensive use of Javascript, for example various Google Products like
The general consensus these days seems to be that you do not store binary

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.