Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to exclude files from a pull request?

I will like to perform a pull and merge request but also I would like to exclude some files from this pull request.

Example: a.py  b.py c.py

I would like to peform a pull request and merge except b.py file.

What is the easiest way to accomplish this?

[edit] the file is not committed it yet.

like image 690
Cory Avatar asked Mar 13 '13 17:03

Cory


People also ask

How do I exclude files from a Git repository?

If you want to ignore a file that you've committed in the past, you'll need to delete the file from your repository and then add a .gitignore rule for it. Using the --cached option with git rm means that the file will be deleted from your repository, but will remain in your working directory as an ignored file.

How do I remove changes to a specific file from a pull request?

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.


2 Answers

Make two branches from where you are right now, for example my-pull-request and other-change.

Commit a.py and c.py to my-pull-request, and b.py to other-change. Push the my-pull-request branch to Github, and create the pull request.

like image 110
CharlesB Avatar answered Sep 20 '22 21:09

CharlesB


Commit a.py and c.py, git stash the rest, perform the request, then git stash pop to restore your b.py

like image 20
favoretti Avatar answered Sep 21 '22 21:09

favoretti