Monday, December 18, 2017

How to remove untracked/ignored files and directories from git local repository


There is always be a need to remove the unwanted files and directories from the git to clean the git local repo, but sometimes it's a tedious job to do if we are not aware of some simple cool features that are offered by git, such as git clean, there is a wonderful and informative article available in git docs.

Here I wanted to give you some useful commands that do the required job of cleaning the untracked or ignored files and directories from the git repo.

This is written according to the git documentation provided here. This should not be considered as a complete guide to git clean.


  • Run this command to see what are the files or dirs going be removed: git clean -n  or   git clean --dry-run 

    So it doesn't actually remove anything, just show what would be done.
  • Run this command to delete the files or directories actually: git cleanBeware that it removes the files and directories permanently!!

    If you want to remove directories, run git clean -f -d or git clean -fd
    If you want to remove ignored files, run git clean -f -X or git clean -fX
    If you want to remove ignored and non-ignored files, run git clean -f -x or git clean -fx

  
It is always advisable to have a glance at the complete documentation at git! Have a look at git clean documentation for a clear understanding.

Monday, December 4, 2017

How to add line numbers attributes to java class files

Add this info to your javac command to add line number attributes to the generated class files: 

javac debug="true" debuglevel="lines,vars,source" includeantruntime="true"