Technoracle
    Facebook Twitter Instagram
    • Sitemap
    • Privacy Policy
    • Disclaimer
    • Term of Services
    Facebook Twitter Instagram Pinterest Vimeo
    TechnoracleTechnoracle
    • Tutorials
      • Amazon Cloud
      • Google Cloud
    • How To
    • Blog
    • About
    Subscribe
    Technoracle
    Home»How To»Remove Directory from Git in 3 steps Quickly
    How To

    Remove Directory from Git in 3 steps Quickly

    Rajesh ShivamBy Rajesh ShivamMay 24, 2021No Comments1 Min Read
    Share Facebook Twitter Pinterest LinkedIn Tumblr Reddit Telegram Email
    Remove Directory from Git
    Share
    Facebook Twitter LinkedIn Pinterest Email
    Remove Directory from Git

    Git is a version control distributed system, we use git for managing our code in the simplest way. In this article, I have explained how to remove directory from Git using some commands.

    Page Contents

    • How to Remove Directory From Git
      • Step 1: Navigate to Local Directory
      • Step 2: Select the Directory to Remove from Git
      • Step 3: Git Commit and Push the Changes
    • Important Git Commands
    • Conclusion

    How to Remove Directory From Git

    Step 1: Navigate to Local Directory

    In the command line navigate to local directory where Git already initialised.

    $ cd git_directory //Navigate to the directory

    Step 2: Select the Directory to Remove from Git

    Now, select the sub directory from the directory to remove from Git. To do that run following command.

    $ git rm -r sub_directory_1

    This will delete the directory from the current directory.

    Step 3: Git Commit and Push the Changes

    Commit the changes with nice git commit message and finally push the code to the Git remote repository.

    $ git commit . -m "Remove duplicated directory"
    $ git push origin <your-git-branch> (typically 'master', but not always)

    Important Git Commands

    • git init
    • git clone
    • git branch
    • git checkout
    • git add
    • git commit
    • git pull
    • git push
    • git diff
    • git status
    • git merge

    Conclusion

    In this short tutorial, you have learned to remove directory from Git. Follow the steps to delete the directory. If you have any doubt, please comment below. I will definitely reply to all your queries.

    git tips important git commands Remove Directory from Git
    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email
    Previous ArticleHow to Manage Bitnami Services Easily | Bitnami Restart Apache
    Next Article How to Install Google Chrome on Ubuntu Easily
    Rajesh Shivam

    Hello, everyone, I am Rajesh Shivam, I am a full-time freelancer with more than seven years plus experience in different freelancing platforms, in this blog, I am going to provide complete freelancing tips and tricks.

    Related Posts

    How To

    How to Install Microsoft Teams on Ubuntu 22.04 Easily

    February 22, 2023
    Read More
    How To

    What is Elastic IP and Its Pricing in AWS

    February 22, 2023
    Read More
    How To

    How to Convert PEM to PPK file [Step by Step Guide]

    February 22, 2023
    Read More
    Add A Comment

    Leave A Reply Cancel Reply

    Facebook Twitter Instagram Pinterest
    © 2023 Technoracle

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

    Go to mobile version