Technoracle
    Facebook Twitter Instagram
    Facebook Twitter Instagram
    TechnoracleTechnoracle
    • Home
    • AWS
      • EC2
      • Lightsail
      • RDS
      • S3
    • Ubuntu
      • Ubuntu 20.04
      • Ubuntu 22.04
    • AI Tools
    • Web Hosting
    • WordPress
    • Tech News
    Technoracle
    Home - Remove Directory from Git in 3 steps Quickly
    Uncategorized

    Remove Directory from Git in 3 steps Quickly

    Rajesh ShivamBy Rajesh ShivamMay 24, 2021No Comments1 Min Read
    Remove Directory from Git
    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 Reddit
    Previous ArticleHow to Manage Bitnami Services Easily | Bitnami Restart Apache
    Next Article How to Install Google Chrome on Ubuntu Easily
    Rajesh Shivam
    • LinkedIn

    Rajesh Shivam is a seasoned professional with expertise in AWS and Linux System Administration. With over 10 years of freelancing experience, he brings a wealth of knowledge to the table. Rajesh has a strong passion for technology and stays connected with the latest happenings in the field. His dedication and expertise make him a trusted resource for all things tech-related.

    Related Posts

    Uncategorized

    How to Get your First Order On Fiverr in 2023 – 5 Proven tricks

    Read More
    Copy File from Local to Remote Server
    Uncategorized

    How to Copy File from Local to Remote Server Easily

    Read More
    increase execution time in PHP
    Uncategorized

    How to Increase Execution Time in PHP

    Read More
    Add A Comment

    Leave A Reply Cancel Reply

    Install Google Chrome on Ubuntu 22.04

    How to Install Google Chrome on Ubuntu 22.04(Easy Guide)

    August 29, 2023
    Enable PHP BCMath Extension in cPanel

    How to Enable PHP BCMath Extension in cPanel (3 Easy Quick Steps)

    August 25, 2023
    install PHP GD on Ubuntu

    How to Install PHP GD on Ubuntu 22.04 [Easy Guide]

    May 2, 2023
    Install PHP on Ubuntu 22.04

    How to Install PHP on Ubuntu 22.04 [Simple Guide]

    April 26, 2023

    Subscribe to Blog

    Enter your email address to subscribe to
    this blog and receive notifications of new posts by email.

    Facebook Twitter Instagram Pinterest
    • Sitemap
    • Privacy Policy
    • Disclaimer
    • Term of Services
    © 2023 Technoracle

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

    Click to Copy
    Go to mobile version