How to delete files or folders in a git repository using Xcode?

My project had several folders that accidentally got added to my GitHub repository. I could delete them (one file at a time) from the GitHub website but that is tedious for a large number of files. I tried using git on the command line but it was conflicting with the Xcode source control updates. I would just like to do it graphically in Xcode if possible.

The closest Xcode question that I could find was this one, but it was about removing source control altogether, which I don’t want to do.

  • Composer: package installation requires svn/git?
  • delete a folder from client machine, if git previleges are revoked
  • Pushing to Git from IntelliJ IDEA gives Permission denied (publickey)
  • JGit create new local branch and push to remote (branch does not exist on remote)
  • How to make git status show only staged files
  • How return previous stage after using git reset --hard?
  • I struggled with this for quite some time but it turned out to be fairly easy. I am sharing my answer below.

  • Drupal Sandbox git repository so big? ( pack file size: 21MB)
  • Include Git revision number inside .NET project
  • NPM package url as dependency in mercurial(bitbucket)
  • Checking when a selection of files have changed
  • Git workflow for web development
  • Git error in Windows 7: git did not exit cleanly (exit code 128)
  • One Solution collect form web for “How to delete files or folders in a git repository using Xcode?”

    As long as you have your project already connected to a remote GitHub repository, all you have to do is use Finder to delete the files or folders.

    Then go to Source Control and choose Commit and after that Push.

    enter image description here

    This will delete the files from your GitHub repository without you having to use the command line.

    Git Baby is a git and github fan, let's start git clone.