Minggu, 09 September 2018

Git - Apply Outset Repository Together With Clone On Local Reckoner Using Git-Bash Cli

GitHub -
Github is a nigh pop cloud-based opened upward source repository system, It allows the squad to act too submit their function at a key location. 


Developer too shop too acquire by their code, equally good equally rail too command changes to their code. mainly used for source code management inwards software development. It is a Command Line Interface(CLI) tool too tin move mastered easily. 


Prerequisites -

  • One Github delineate organisation human relationship - You tin ready your gratis delineate organisation human relationship (if don't have).
  • One Windows Machine amongst installed Git software.
Step 1- Download too install Git Software -
You tin download the latest version of Git from its official's site - https://git-scm.com/downloads
Once terminal the download, You tin start the installation past times double click on file - Git-2.18.0-64-bit.exe. It's real slow installation simply follow the steps.

Step 2- Create First Repository on GitHub:
Let's follow the steps below to produce your get-go Github repository -
  • Log on to your GitHub delineate organisation human relationship - https://github.com/login
  • Create your get-go Repo on the login page click on New Repository
  • On the side past times side shroud come inwards your repository name (myfirstrepo) > cheque on Public > click Initialize this repository amongst Readme  > Click on Create Repository.
Your Repository has created too initialized. Your side past times side shroud should move similar this.


Step 3- Setup SSH key 
In this case, we already initialized our repository spell nosotros ready it on GitHub delineate organisation human relationship too hence no necessitate to initialized here. 
Now, Open Git Bash on your local calculator too follow the steps below-
  • On the Git Bash command type command below too striking the come inwards push clit to generate SSH key.
$ ssh-keygen -t rsa -C "asingh@domain.com" 
You volition acquire output similar inwards below image.
  • Now opened upward /C/Users/amar/.ssh/id_rsa.pub file inwards your favourite editor too re-create the SSH key. You tin respect your file path inwards the electrical flow user's habitation directory within folder .ssh.

$ vi /c/Users/amar/.ssh/id_rsa.pub  ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDyph6mttPuEnUOWJFTuRmFNp7WS4xe1x4WPTzlanMf5PnTv1TQxWbchaITQQMGCqF+3/6/r8JTip5yuC0vaku+0CmFPCVfk3w8dmqew3n8b3/ki98ieei8OnPuALDC7+lrcknstl+MnF3WDsyi0ZEfvABaj6m3BUIGfwawG18+wcvgpaYYoPnKEXvYLY1D05ZlBW/9EQuHLHNimXGiwRqLFBI5qYSBC9pRXLA6X10gbaFORKuYJSQkpP4dKj7F8aD1tIASW55DtDtVrEWf2avyRh5Hca6Y0cO3+HvKnCSie3sUyZ+8A9gJmQ7sv629uIGNmpZrJGE9hfrv72zKgkH6f asingh@gmail.com 
  • Copy inwards a higher house ssh key too glue into your GitHub account.
  • Go into Git Hub delineate organisation human relationship settings -
  • Now, click on SSH too GPG key push clit on left side > NewSSH key as inwards below picture.

  • Now re-create your SSH key inwards the box. Copy SSH key from local organisation path -/C/Users/amar/.ssh/id_rsa.pub
Once you lot glue the SSH key click on Add SSH key button.

Step 4- Clone repository to your local system.
After successfully added SSH key, Your Git Bash is produce to clone your get-go Repository.
  • Log on to your GitHub delineate organisation human relationship too re-create Repository URL equally inwards the flick below - Change clone type to SSH earlier you lot re-create the URL


  • Once you lot re-create the repository URL type below command at your Git Bash shell.
$ git clone git@github.com:amars1986/myfirstrepo.git
  • Now become to your cloning path 
$ cd myfirstrepo/
  • Check the Repository condition using the git status command.
$ git condition  On branch master copy Your branch is upward to appointment amongst 'origin/master'.  zip to commit, working tree clean 
Your Git repository master copy branch is up-to-date. 

Your get-go cloning completed successfully, In my side past times side spider web log nosotros volition larn how to create, add, commit too force newly added file too folder to out Git repository


Sumber https://linuxhowtoguide.blogspot.com/

Tidak ada komentar:

Posting Komentar