DevOps Classroomnotes 13/Sep/2022

Fourth Area of Git

  • The fourth area of git is Remote Repository
  • Remote Repository is a Git with some server features (Connectiviy, User managment)
  • Remote Repository can be
    • Self hosted (Where we install on one of our servers)
      • Gitolite
      • Gitlab
      • BitBucket
    • Cloud Hosted (Where the git with server featuers is preinstalled and you just need to configure users, repositories etc)
      • GitHub
      • GitLab
      • BitBucket
      • Azure Source Repos
      • AWS Code Commit
        Preview

Scenario – 1

  • You have started working locally and created some commits
  • Now you want this code to be shared with your team members
  • We create a Remote Repository & then push the changes from your local repo to remote Repo
  • Local Repository with two changes
    Preview

GitHub

  • Create a GitHub Account
  • Lets use SSH authentication
  • Lets create SSH key pair in your system
    Preview
  • Press Enter for the next inputs which ssh-keygen asks
  • In your home directory (c:\users\<username> in windows /Users/<username> in mac and /home/<username> in linux) a .ssh folder will be created with two files
    • id_rsa => private key => to keep secure locally
    • id_rsa.pub => public key => Git remote repository
  • Lets add this ssh key to the GitHub
  • Navigate to settings for user and do the below steps
    Preview
  • Now add the ssh public key contents
    Preview
    Preview
  • Our authentication is ssh-based, Get the remote url from Git Hub
    Preview
  • Remote repository connection can be added to your local repository git remote add <name-of-remote> <remote-url>
  • The default remote name used is origin
  • Now my command would be git remote add origin git@github.com:GitPracticeRepo/qt_hospital_app.git
    Preview
  • Now we need to push the changes git push <remote-name> <branch-name> is the command to push
    Preview
    Preview
    Preview
  • We have pushed the changes to Github Refer Here and Gitlab Refer Here

Published
Categorized as Uncategorized Tagged

By continuous learner

devops & cloud enthusiastic learner

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Please turn AdBlock off
Animated Social Media Icons by Acurax Responsive Web Designing Company

Discover more from Direct DevOps from Quality Thought

Subscribe now to keep reading and get access to the full archive.

Continue reading

Visit Us On FacebookVisit Us On LinkedinVisit Us On Youtube