DevOps Classroomnotes 25/Feb/2023

Git Authentication Methods

  • Git has two popular authentication methods
    • username and password/token
    • ssh key pair
  • Creating a PAT for GitHub Refer Here
  • Use ssh-keygen to generate id_rsa and id_rsa.pub files in <HOME-DIR>/.ssh
  • copy the id_rsa.pub in GitHub => Settings => SSH and GPG keys => New SSH Key

Git Remote and Branches

  • The command to push git push <remote-name> <branch-name>

Upstream branches

  • In Git while pushing the code if we observe the following errors
    Preview
    Preview
  • By setting the upstream branch we are setting the default remote

Making changes in Local commits

  • We have the latest commit in which there is typo in commit message which we want to correct
    Preview
    Preview
  • Now i want to delete this extra commit and then fix typo
  • Clone the code from Refer Here
  • git commit --amend can be used to reword the latest commit not previous
  • Look at classroom video to
  • edit: make the changes in commit
  • reword: change the commit message
  • squash: combine commits
  • Exercise: Refer Here. Try to solve atleast 10 exercises.

Git Repository Types

  • Bare Repository: This repository will have only .git folder no working tree. This is used generally on server sides on git remotes
  • mirror Repostiory: This repository also will have only .git folder and used to cater to other users
  • Normal Repositoru: Here we get working tree as well as .git and is used for development.

Other topics

  • Force push git push --force this command pushes the changes to git remote and overrides the remote repo history.
  • Git maintains two logs in your local repo
    • log
    • ref log: maintains the history of all changes done into local
      Preview
  • Try git log examples and git diff examples

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 Wordpress Development 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