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

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

Lets clone a repo

  • Let clone git clone repo-url
  • lets cd into folder and execute git commands
  • Lets create a commit and push the changes
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
Social Media Icons Powered by Acurax Web Design Company
Exit mobile version
%%footer%%