Remove directory from git and local
You could checkout ‘master’ with both directories;
git rm -r one-of-the-directories // This deletes from filesystem git commit . -m "Remove duplicated directory" git push origin <your-git-branch> (typically 'master', but not always)
Remove directory from git but NOT local
As mentioned in the comments, what you usually want to do is remove this directory from git but not delete it entirely from the filesystem (local)
In that case use:
git rm -r --cached myFolder
Related Posts:
- Does Git Add have a verbose switch
- git error: failed to push some refs to remote
- Git error: “Please make sure you have the correct access rights and the repository exists”
- Untrack files from git temporarily
- Git, fatal: The remote end hung up unexpectedly
- Git – remote: Repository not found
- Pushing to Git returning Error Code 403 fatal: HTTP request failed
- Git master branch has no upstream branch
- How can I determine the URL that a local Git repository was originally cloned from?
- How to pull from one remote branch to another branch in git?
- Trying to git pull with error: cannot open .git/FETCH_HEAD: Permission denied
- How to git add a whole folder
- What does ‘git remote add upstream’ help achieve?
- git status (nothing to commit, working directory clean), however with changes commited
- How can I rollback a git repository to a specific commit?
- gpg failed to sign the data fatal: failed to write commit object
- Git pull origin
overwrites master? - Git merge with force overwrite
- Git Push ERROR: Repository not found
- Why does Git tell me “No such remote ‘origin'” when I try to push to origin?
- git returns http error 407 from proxy after CONNECT
- Git pull till a particular commit
- “fatal: HttpRequestException encountered.” Error with GitHub/Bitbucket Repositories due to dropping TLS-1.0 support
- Why does Git say my master branch is “already up to date” even though it is not?
- SourceTree keeps asking for Github password
- Git Clone – Repository not found
- git SSL certificate- Invalid certificate chain while accessing
- Why I always Got Error “Push to origin/master was rejected”?
- fatal: could not read Username for ‘https://github.com’: No such file or directory
- Git push existing repo to a new and different remote repo server?
- What is .gitignore exactly?
- How can I switch to another branch in git?
- GitHub: Permission denied (publickey). fatal: Could not read from remote repository
- GitHub – error: failed to push some refs to ‘[email protected]:myrepo.git’
- git – remote add origin vs remote set-url origin
- GitHub Error Message – Permission denied (publickey)
- Updating a local repository with changes from a GitHub repository
- Git push results in “Authentication Failed”
- github changes not staged for commit
- Git : fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists
- Git push results in “Authentication Failed”
- Download single files from GitHub
- How to draw checkbox or tick mark in GitHub Markdown table?
- How do I pull my project from github?
- Ignoring directories in Git repositories on Windows
- Difference between Git and GitHub
- Is it safe to download code from GitHub?
- How to draw checkbox or tick mark in GitHub Markdown table?
- How to solve SSL certificate: self signed certificate when cloning repo from github?
- How to upload folders on GitHub
- How to find my GitHub username so that I can be found via the URL?
- github website publish cannot publish unborn HEAD
- git : Pull is not possible because you have unmerged files
- fatal: The current branch master has no upstream branch
- Superscript in markdown (Github flavored)?
- Create a tag in a GitHub repository
- How to fix HTTP 404 on Github Pages?
- Git: Could not resolve host github.com error while cloning remote repository in git
- How to pull a specific branch from Github
- GitHub: invalid username or password
- “Cannot publish, unborn head” error message
- Trying to git pull with error: cannot open .git/FETCH_HEAD: Permission denied
- How can I give access to a private GitHub repository?
- How do I update or sync a forked repository on GitHub?
- Can I share my private GitHub repository by link?
- There is no tracking information for the current branch
- Git push results in “Authentication Failed”
- Meaning of the GitHub message: push declined due to email privacy restrictions
- How do I create a folder in a GitHub repository?
- How to rename a directory/folder on GitHub website?
- “*** Please tell me who you are.” when using SSH key
- Download a single folder or directory from a GitHub repo
- Pull request vs Merge request
- Clone A Private Repository (Github)
- How do I rename a repository on GitHub?
- What do raw.githubusercontent.com URLs represent?
- Superscript in markdown (Github flavored)?
- error: cannot lock ref.. ‘refs/tags’ exists; cannot create ‘refs/tags/
- Not a valid object name: ‘master’
- “Key is invalid” message on GitHub
- Your configuration specifies to merge with the
from the remote, but no such ref was fetched.? - git submodule add error: does not have a commit checked out
- Git: Installing Git in PATH with GitHub client for Windows
- ! [rejected] master -> master (fetch first)
- ‘cannot open git-upload-pack’ error in Eclipse when cloning or pushing git repository
- How to git add a whole folder
- How to change folder with git bash?
- Github “Updates were rejected because the remote contains work that you do not have locally.”
- My new Github page isn’t showing up
- How to add images to README.md on GitHub?
- How can I remove a commit on GitHub?
- Updates were rejected because the remote contains work that you do not have locally
- Unity Collaborate vs GitHub
- Where can I find the GitHub ID in my account?
- how to un fork the github repository?
- Python not working in the command line of git bash
- Delete branches in Bitbucket
- How do I set up Eclipse/EGit with GitHub?
- Create a new file in git bash
- Repository size limits for GitHub.com