git Tutorial
Introduction Installing Git Understanding Git architecture Initializing the new Git respository Cloning new Git repository .git directory in Git repository Viewing Git configuration First time Git configuration Using SSH keys with Git Checking Git status Adding files into staging area in Git Committing changes to the local repository Ignoring files using .gitignore Viewing the history of commits Viewing the file contents in working directory, staging area and repository Viewing difference between files Viewing the history of files Git revert Git Reset git reflog Creating and switching to new branches in Git Viewing existing branches Merging branches Resolving conflicts Rebase Deleting branches Renaming the branch in Git Push Pull Stashing the changes in Git Tags in Git Patches in Git Creating new repository on GitHub Pushing local repository to remote repository like GitHub IntelliJ IDEAIgnoring files in git
By default, all files that we add to working directory are tracked by Git. But sometimes, we do not bother about changes in those files. For example – Consider maven project. When the project is built using maven, it creates target directory. We are not interested in storing this directory and all it’s contents. How to tell Git not to track specific files? That’s when .gitignore comes into picture. .gitignore is the special file that can be created and stored in the root of the Git repository. It contains the list of files or directories that should be ignored. Here is the sample .gitignore file contents for various types of Java project. Notice that to ignore directory and its entire contents you have to use / at the end of directory name.Files to be ignored for IntelliJ IDEA Project
.idea/ *.iml *.iwsFiles to be ignored for Maven Project
target/ log/Files to be ignored for Eclipse Project
.classpath .projectTo ignore all files ending with .xml
*.xml Below example shows that even though we create and change the XML file, Git does not track it as we have added *.xml line in .gitignore file.- gitignore example in Git
- gitignore example in Git
Web development and Automation testing
solutions delivered!!