I have make pull request on git (with \"xcodeproj/project.pbxproj\" file - my fault), so can I delete this file from created Pull Request? Thanks..
To remove a file from your PR:
git rm path/toFile/youwantRemovedOffyour/PR
git commit -a
git push
To remove a directory from your PR:
git rm -r path/toFiles/youwantRemovedOffyour/PR
git commit -a
git push
The offending file will still be in the changesets to be merged, mind you, so if it contains sensitive data it's best to close the pull request and wipe out the file from your fork's repository first. Github help describes how to do that.
Another solution would be to
This will update the pull request by only displaying your refreshed commit(s).
New approach, since July 2018:
Removing files from a pull request
Previously, if you wanted to use GitHub to remove files from a pull request, you’d need to switch to the pull request branch and look for the individual file to delete it.
Now, if you have write permission, you can click on the ‘trash’ icon for a file right in the pull request’s “Files changed” view to make a commit and remove it.
Warning: as confirmed by RCM in the comments:
It does delete the file.
It DOES NOT mean it will remove your changes to the file.
It is quite deceptively worded, in my opinion.
You probably will merge this pull request on master, so you can checkout just this specific file again, from master, on your branch, just type:
git checkout master -- xcodeproj/project.pbxproj
git commit -m "removing a file from PR"
git push origin {YOUR BRANCH}
If all you want to do is just remove(delete) the changeset of a file that is already a part of the pull request, currently you can't do that via the web UI. You have to update the file locally and do a git push to the PR.