Git Product home page Git Product logo

connecting_to_github_with_ssh's Introduction

Connecting_to_GitHub_with_SSH

Hello guys
In this rep we want to connect to github with ssh, in other word we want to push without giving passwd every time. (not just this, using ssh is much safer than reguler way)

In the first you have to have a GNU/linux Distribution OS :| of course I did not say that seriously, just being unix-like is enouch ...

forget last paragraph, even if you have windows you can use ssh, but please shift delete windows and install ubuntu for the sake of all of us.

Until now we have a unix-like os, open a terminal and run:

ssh-keygen -t rsa -b 4096 -C "your email address"

then read the std-in and anwser them :| If you set fingerprint(passwd for you key) every time that you want to use your key you have to give your passwd, then i suggust don't set passwd.
Running ssh-agent:

eval "$(ssh-agent -s)"

# ssh-add ~/.ssh/your-key-name
# if you did not change that:
ssh-add ~/.ssh/id_rsa

now it's time for putting public key to github account you can copy that by hand(cat) or using(xclip):

xclip -selection clipboard < ~/.ssh/id_rsa.pub

If you don't have xclip:

sudo apt install xclip
# or
sudo dnf install xclip
# or
sudo pacman -Sy xclip

After you have copied your pub key, go to your github account, setting, ssh and gpg keys, new ssh key (title is no important) and add your pub key:

In this part you can check that your ssh working or not:

And make your repository, set your remote config and push that:
# creating project and git stuff ...
git remote add origin [email protected]:username/test.git
git push -u origin master

Before running above code, you need to Add repository in github account and using that name instead of test.git >> your_rep_name.git
You may need to use 'main' or ... instead of 'master'
Use 'git log' for seeing the name of HEAD branch, if you didn't change that, it is 'master'

Distorting of the information was unnecessary because they were pub key not private, but better is safe than sorry.

babay @_@

connecting_to_github_with_ssh's People

Contributors

ahghanbari 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.