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
- Java:
- Create git ingore files for the following combinations
Moving Changes from staging area to working tree and remove the changes from working tree
- Ensure only main.py is committed
- History
- Remove the app.py changes from working tree
- Revisit Git Areas
- To remove all the untracked files from a specific folder
git clean -fd <path>
* 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
* By default master always looks at latest commit and HEAD represents what your working tree is looking at
* Lets move our head to 2 commit
git checkout <commit-id>
* To go back to latest commit
git checkout master