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

  • 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

  • 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
  • Try git log examples and git diff examples
Published
Categorized as Uncategorized Tagged

By continuous learner

devops & cloud enthusiastic learner

Leave a comment

Turn on JavaScript to leave a comment.

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

Please turn AdBlock off
Customized Social Media Icons from Acurax Digital Marketing Agency
Exit mobile version
%%footer%%