How to exclude files from a pull request?

14,414

Solution 1

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.

Solution 2

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

Share:
14,414
Cory
Author by

Cory

Located in San Diego, CA.

Updated on June 19, 2022

Comments

  • Cory
    Cory almost 2 years

    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.

  • Domi
    Domi over 8 years
    This is insufficient if you have already committed the unwanted file to the branch that you want to merge
  • favoretti
    favoretti over 8 years
    @Domi OP stated that the file is not committed yet.