Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Delete file from Pull Request on GitHub

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..

like image 759
LightNight Avatar asked Feb 29 '12 11:02

LightNight


People also ask

What happens if you delete file from Github pull request?

Removing files from a pull request 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.

How do I delete a file from github repository?

Browse to the directory in your repository that you want to delete. In the top-right corner, click , then click Delete directory. Review the files you will delete. At the bottom of the page, type a short, meaningful commit message that describes the change you made to the file.

Can you delete a Github pull request?

In the list of pull requests, click the pull request that's associated with the branch that you want to delete. Near the bottom of the pull request, click Delete branch.


2 Answers

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} 
like image 99
Albert Abdonor Avatar answered Sep 30 '22 19:09

Albert Abdonor


Another solution would be to

  • Locally rewrite your commit(s) by removing the file, using amend or rebase git features
  • Force push your branch toward your GitHub repository

This will update the pull request by only displaying your refreshed commit(s).

like image 37
nulltoken Avatar answered Sep 30 '22 19:09

nulltoken