DevOps Classroomnotes 08/Jul/2023

Git Contd

  • Lets initialize the new repo in a local system
  • Add 3 commits into the repo
  • git add comes with 4 major options for adding changes
    • git add
    • git add . adding all the changes relative to current directory
    • git add -A add all the changes
    • git add -u add only modified files
  • Add the changes to staging area try to unstage
    Preview
  • To unstage the popular option is git restore --staged
  • To remove the changes from working tree

    • modified: git restore
    • untracked:
      • delete normally
      • git clean -fd .
        Preview
  • Exercise: What is soft reset vs hard reset
git reset --hard
git reset --soft

Branching

  • In Git Branches support parllel development
  • Every git repository will have a default branch called as master
  • Branch will always point to the latest commit
  • HEAD pointer in Git refers to what commit is working tree looking at.
  • To move the HEAD pointer we can use checkout command
  • Lets create one branch appollo

Note:

Leave a Reply

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

About continuous learner

devops & cloud enthusiastic learner