Facebook Twitter Instagram
    TecAdmin
    • Home
    • Ubuntu 20.04
      • Upgrade Ubuntu
      • Install Java
      • Install Node.js
      • Install Docker
      • Install LAMP Stack
    • Tutorials
      • AWS
      • Shell Scripting
      • Docker
      • Git
      • MongoDB
    • FeedBack
    • Submit Article
    • About Us
    Facebook Twitter Instagram
    TecAdmin
    Home»GIT»How to Remove a directory from Git Repository

    How to Remove a directory from Git Repository

    RahulBy RahulMay 4, 20191 Min ReadUpdated:June 24, 2021

    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.

    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
    Previous Articlehow to change permissions of folder and subfolders in Linux
    Next Article How to Setup Laravel File Permissions Correctly

    Related Posts

    How To Add a Git Remote Repository

    3 Mins Read

    How to Git Reset to Head

    Updated:November 3, 20213 Mins Read

    How to Delete a File on Git

    3 Mins Read

    How to Git Stash Changes

    Updated:October 29, 20213 Mins Read

    How to delete Git tags

    Updated:October 25, 20211 Min Read

    How to Create Git tags

    Updated:October 25, 20212 Mins Read

    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

    Recent Posts
    • How to Enable / disable Firewall in Windows
    • How to Install JAVA on Ubuntu 22.04
    • Switching Display Manager in Ubuntu – GDM, LightDM & SDDM
    • Changing the Login Screen Background in Ubuntu 22.04 & 20.04
    • How To Install PHP (8.1, 7.4 or 5.6) on Ubuntu 22.04
    Facebook Twitter Instagram Pinterest
    © 2022 Tecadmin.net. All Rights Reserved | Terms  | Privacy Policy

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