Maitiro ekuisa Git paMac uye Gadzira SSH Keys

Mune ino nhanho-nhanho Git Tutori, isu tichaenda kuburikidza nekuisa sei Git pane Mac muchina, maitiro ekugadzira SSH makiyi uye kurodha yako yeruzhinji SSH kiyi kune yako GitHub account yekubvumidzwa.

Maitiro ekuisa Git paMac

Vhura terminal uye nyora

$ brew install git

Izvi zvichaisa Git pane yako system. Kuti usimbise kuisirwa, nyora

$ git --version

Izvi zvichapurinda vhezheni yeGit yakaiswa pamushini wako.

Maitiro ekugadzira kiyi yeSSH yeGitHub mvumo

  1. Vhura terminal
  2. Enda kune yako dhairekitori repamba nekutaipa cd ~/

  3. Nyora unotevera kuraira ssh-keygen -t rsa



    • Izvi zvinokukurudzira kuti uise zita rezita rekuchengetedza kiyi

    • Ingo pinda pinda kuti ugamuchire default zita rezita (/Users/you/.ssh/id_rsa)

    • Ipapo inokumbira iwe kuti ugadzire passphrase. Izvi ndezvokusarudza, kungaita gadzira passphrase kana pinda pinda pasina passphrase

  4. Paunodzvanya pinda, mafaera maviri anogadzirwa

    • ~/.ssh/id_rsa

    • ~/.ssh/id_rsa.pub

  5. Kiyi yako yeruzhinji yakachengetwa mufaira rinopera ne .pub, kureva ~/.ssh/id_rsa.pub

Maitiro ekuwana uye kuteedzera yeruzhinji SSH kiyi

Kuti uzvisimbise iwe nemidziyo yako neGitHub, unofanirwa kuisa kiyi yako yeruzhinji yeSSH yawakagadzira pamusoro kuakaundi yako yeGitHub.

Kopa yeruzhinji SSH kiyi

Vhura terminal uye nyora

$ pbcopy < ~/.ssh/id_rsa.pub

Izvi zvinoteedzera zvirimo mune id_rsa.pub faira kune yako clipboard.

Inoenderana:

Maitiro ekuisa yako yeruzhinji SSH kiyi kuGitHub

  1. Paunenge uchinge wateedzera yako yeruzhinji SSH kiyi, pinda kune yako GitHub account uye enda ku
  2. https://github.com/settings/profile
  3. Kuruboshwe-kurudyi menyu, iwe uchaona chinongedzo 'SSH uye GPG makiyi'
  4. Dzvanya pane iyi link iyo inokuendesa kune peji kwaunogona kuisa yako yeruzhinji SSH kiyi iwe yawakateedzera kare.
  5. Dzvanya bhatani rinoti 'Nyowani SSH kiyi'
  6. Wobva waisa zita remusoro - rinogona kuva chero chinhu, i.e. newMac
  7. Namatira kiyi yeruzhinji yeSSH mubhokisi rekiyi
  8. Dzvanya 'Wedzera kiyi yeSSH'

Edza mvumo yako yeGitHub:

Vhura terminal uye nyora

$ git clone git@github.com:AmirGhahrai/Rima.git
  1. Ichakubvunza iwe kana iwe uchida kuramba uchibatanidza, nyora hongu
  2. Kana iwe ukagadzira passphrase pawaive uchigadzira ruzhinji kiyi, ipapo inokukumbira iwe kuti upinde.
  3. Pinda chinyorwa chako uye pinda pinda.
  4. Ichabva yatanga kuumbiridza chirongwa ichi kune dhairekitori rako.

Mese mava kugadzirirwa kushandisa Git uye GitHub.