DevOps Classroom notes 14/Nov/2023

Git Contd

  • Git identifies changes w.r.t files not folders. Empty folder is not a change in git.
  • We can configure git to ignore some files or folders. To do this we need to create a file called as .gitignore in the root folder of the repository. To create ignore based on tools and languages Refer Here
  • Exercise:
    • Create git ingore files for the following combinations
      • Java:
        • IDE: Eclipse
        • Build: Maven
      • Dotnetcore:
        • IDE: Visual Studio
      • ReactJs:
        • IDE: visual studio code
      • Terraform:
        • IDE: visual studio code
      • Ansible:
        • IDE: visual studio code

Moving Changes from staging area to working tree and remove the changes from working tree

  • Ensure only main.py is committed
    Preview
    Preview
    Preview
  • History
    Preview
  • Remove the app.py changes from working tree
    Preview
  • Revisit Git Areas
    Preview
  • To remove all the untracked files from a specific folder
git clean -fd <path>

Preview
* We have executed git reset --hard
* We have two other flavors of git reset
* soft
* mixed
* I will be discussing on when to use what in next 3 days
* When we execute git status and git log along with status we see one extra term master
Preview
* By default master always looks at latest commit and HEAD represents what your working tree is looking at
Preview
Preview
Preview
* Lets move our head to 2 commit

git checkout <commit-id>

Preview
Preview
* To go back to latest commit

git checkout master

Preview
Preview

Leave a Reply

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

About continuous learner

devops & cloud enthusiastic learner