Git Product home page Git Product logo

story_teller's Introduction

Push local code to a new but existing repository

$ echo "# story_teller" >> README.md
$ git init
$ git add README.md
$ git commit -m "first commit"
$ git branch -M main
$ git remote add origin https://github.com/vatsaaa/story_teller.git
$ git push -u origin main

Problem: Every push prompt me to input username and password. I would like to avoid it for every push, but how to configure to avoid it?

Answer: Using SSH authentication on terminal.

  1. Generate an SSH key

Linux/Mac Open terminal to create ssh keys:

cd ~ #Your home directory ssh-keygen -t rsa #Press enter for all values For Windows (Only works if the commit program is capable of using certificates/private & public ssh keys)

Use Putty Gen to generate a key Export the key as an open SSH key Here is a walkthrough on putty gen for the above steps

  1. Associate the SSH key with the remote repository

This step varies, depending on how your remote is set up.

If it is a GitHub repository and you have administrative privileges, go to settings and click 'add SSH key'. Copy the contents of your ~/.ssh/id_rsa.pub into the field labeled 'Key'.

If your repository is administered by somebody else, give the administrator your id_rsa.pub.

  1. Set your remote URL to a form that supports SSH 1

If you have done the steps above and are still getting the password prompt, make sure your repo URL is in the form

git+ssh://[email protected]/username/reponame.git as opposed to

https://github.com/username/reponame.git To see your repo URL, run:

git remote show origin You can change the URL with:

git remote set-url origin git+ssh://[email protected]/username/reponame.git

More details: https://www.youtube.com/watch?v=TCcWwUgQe8s

story_teller's People

Contributors

vatsaaa avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.