git clean

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #3401 Reply
    Humble
    Keymaster

    Most of the times, we want to remove references to the ‘untracked files’ in the working directory.

    For ex:

    hchiramm@localhost libgfapi-python]$ git status
    # On branch master
    # Untracked files:
    #   (use "git add ..." to include in what will be committed)
    #
    #	.idea/
    #	doc/markdown/.dev_guide.md.swp
    #	libgfapi-python-1.0.0.tar.gz
    #	libgfapi-python.spec
    #	libgfapi.egg-info/
    #	libgfapi/
    #	test/unit/results.html
    nothing added to commit but untracked files present (use "git add" to track)
    
    
    The easiest way of cleaning the 'untracked files/directories' are by 'git clean' command. BUT, before you execute the command make sure you are not deleting the right files. 
    
    The best option is executing   a 'dry-run' ( -n or --dry-run option)  on the same before doing the actions. 
    
    For ex:
    
    [hchiramm@localhost libgfapi-python]$ git clean -n
    Would remove doc/markdown/.dev_guide.md.swp
    Would remove libgfapi-python-1.0.0.tar.gz
    Would remove libgfapi-python.spec
    Would remove test/unit/results.html
    
    
    To remove directories you can make use of "-d" option. 
    
    
    [hchiramm@localhost libgfapi-python]# git clean -f -d
    Removing doc/markdown/.dev_guide.md.swp
    Removing libgfapi-python-1.0.0.tar.gz
    Removing libgfapi-python.spec
    Removing test/unit/results.html
    Removing libgfapi.egg-info/
    Removing libgfapi/
    [hchiramm@localhost libgfapi-python]
    
    Now my directory is "CLEAN"
    
    
    [hchiramm@localhost libgfapi-python]# git status
    # On branch master
    nothing to commit, working directory clean
    [hchiramm@localhost libgfapi-python]# 
    

    #9531 Reply
    Todaysscope
    Guest

    I found the content on this website interesting and informative, with plenty of useful points to explore. The articles are presented in a straightforward style that makes the information easy to follow. Todaysscope provides readers with fresh ideas and helpful insights across different topics. I appreciate the simple presentation and the effort put into making each post engaging. Overall, it is a useful website for readers who enjoy discovering new and informative content.

    #13851 Reply
    sigoj bzaka
    Guest

    Hi folks, I ran across this article while reading about men’s hormone health and wondering how doctors determine whether testosterone levels are appropriate. There are so many numbers mentioned in online conversations that I found myself wondering whether there is actually one ideal level for everyone. The explanation at https://ways2well.com/blog/what-is-the-ideal-testosterone-level-for-mens-health helped me understand why the subject is more complicated than simply chasing a particular number. I liked the emphasis on overall health and individual circumstances. It made more sense to me to consider symptoms, testing, and medical context together rather than treating one laboratory result as the complete picture.

Viewing 3 posts - 1 through 3 (of 3 total)
Reply To: git clean
Your information: