DevOps Classroom notes 27/Mar/2025

Recovering Deleted commits

  • Git has two types of logs
    • log
    • ref-log: This is a permanent log but available only in .git folder
  • Watch classroom video for steps

Detached Head

  • Detached Head refers to a state where HEAD is pointed towards a commit rather than a branch.
  • We can use this for verifying changes but never start committing changes in this case, as changes might be lost.
  • Best Practice: If you want to work on the older commit,
    • checkout to that commit
    • create a branch from there git switch -c "<branch-name>"
    • Now make changes in this branch
    • if the changes are required any where else use merge or cherry-pick.

Remote

  • Git remote is another repo which is ideally containing the same code as yours.
  • Git Remote can be hosted
    • locally on your system for local usage (This doesnot make sense)
    • Organizations hosting git on servers owned by them (Self Hosted Git)
      • Gitolite
      • Gerrit (Hosting + Code Reviews)
      • Gitlab Self Hosted Version
      • GitHub Enterprise (SelfHosted)
    • Cloud Hosted Git Remotes
      • GitHub
      • Azure Source Repos
      • AWS Code Commit
      • Atlassian Bit Bucket
      • GitLab

Fourth Area of Git

  • Remote Repo
    Preview

Terms

  • Clone: When you donot have local copy of the repo and want it on your system you perform clone
  • pull: to get the latest commits into your local repo (need to dive more)
  • push: to send the commits from your local repo to remote repo
  • Every remote repo has a url and a name. origin is the default remote repo name.

Lets create a repo in github

  • In github we can create public repos or private repos.
  • Let me create a public repo
    Preview

Lets clone a repo

  • Let clone git clone repo-url
    Preview
  • lets cd into folder and execute git commands
    Preview
  • Lets create a commit and push the changes

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