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

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
Plugin for Social Media by Acurax Wordpress Design Studio

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