Facebook Twitter Instagram
    TecAdmin
    • Home
    • FeedBack
    • Submit Article
    • About Us
    Facebook Twitter Instagram
    TecAdmin
    You are at:Home»GIT»How to Remove a directory from Git Repository

    How to Remove a directory from Git Repository

    By RahulJune 24, 20211 Min Read

    Use rm -r switch with the git command to remove directory recursively. After removing the directory you need to commit changes to the local git repository. Then push the changes to remove the directory from the remote git repository.

    Advertisement

    Use the command line below to remove the directory named test_dir from the current directory.

    git rm -r test_dir
    

    Then commit and push to apply changes in the local and remote repository.

    git commit -m "Removed test directory"
    git push origin master   # Change 'master' with your branch name
    

    All done, The test_dir has been removed from the local as well as the remote git repository.

    git
    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email WhatsApp

    Related Posts

    Git Restore: Functionality and Practical Examples

    Git Switch: Functionality and Practical Examples

    Git Switch vs. Checkout: A Detailed Comparison with Examples

    Git Switch vs. Checkout: A Detailed Comparison with Examples

    View 1 Comment

    1 Comment

    1. Dergax on February 27, 2020 8:45 pm

      a little beat to late wrote from local repository

      Reply

    Leave A Reply Cancel Reply

    Advertisement
    Recent Posts
    • Setting Up Angular on Ubuntu: Step-by-Step Guide
    • Converting UTC Date and Time to Local Time in Linux
    • Git Restore: Functionality and Practical Examples
    • Git Switch: Functionality and Practical Examples
    • Git Switch vs. Checkout: A Detailed Comparison with Examples
    Facebook Twitter Instagram Pinterest
    © 2023 Tecadmin.net. All Rights Reserved | Terms  | Privacy Policy

    Type above and press Enter to search. Press Esc to cancel.