create pull request from fork with only certain filesHow to cherry pick a range of commits and merge into another branch?How to remove local (untracked) files from the current Git working tree?Showing which files have changed between two revisionsCommit only part of a file in GitHow do I force “git pull” to overwrite local files?How to get just one file from another branchHow to replace master branch in Git, entirely, from another branch?What is the best (and safest) way to merge a Git branch into master?How can I reconcile detached HEAD with master/origin?Why do I need to do `--set-upstream` all the time?Git fetch remote branch

How to stretch the corners of this image so that it looks like a perfect rectangle?

How obscure is the use of 令 in 令和?

Can I hook these wires up to find the connection to a dead outlet?

How badly should I try to prevent a user from XSSing themselves?

"the same as" in a sentence

How to compactly explain secondary and tertiary characters without resorting to stereotypes?

Venezuelan girlfriend wants to travel the USA to be with me. What is the process?

GFCI outlets - can they be repaired? Are they really needed at the end of a circuit?

How to show a landlord what we have in savings?

meaning of 腰を落としている

Why were 5.25" floppy drives cheaper than 8"?

What is the most common color to indicate the input-field is disabled?

How to Prove P(a) → ∀x(P(x) ∨ ¬(x = a)) using Natural Deduction

What historical events would have to change in order to make 19th century "steampunk" technology possible?

How do I exit BASH while loop using modulus operator?

how do we prove that a sum of two periods is still a period?

Does the Idaho Potato Commission associate potato skins with healthy eating?

Is this draw by repetition?

Theorists sure want true answers to this!

Description list Formatting using enumitem

Why is the sentence "Das ist eine Nase" correct?

Can someone clarify Hamming's notion of important problems in relation to modern academia?

ssTTsSTtRrriinInnnnNNNIiinngg

Different meanings of こわい



create pull request from fork with only certain files


How to cherry pick a range of commits and merge into another branch?How to remove local (untracked) files from the current Git working tree?Showing which files have changed between two revisionsCommit only part of a file in GitHow do I force “git pull” to overwrite local files?How to get just one file from another branchHow to replace master branch in Git, entirely, from another branch?What is the best (and safest) way to merge a Git branch into master?How can I reconcile detached HEAD with master/origin?Why do I need to do `--set-upstream` all the time?Git fetch remote branch













1















My current repo is ahead of the repo I forked from. I was wondering, is there a way I can create a new branch off of master, pull in the files I changed, and create a PR from this branch?



The issue is I don't want to create a PR for all of my changes in master. For example, I have changes to:



src/
file1
file2
file3


from my master to theirs in my fork. I want to pull in all there changes, and then only send my changes to file2 in a PR.










share|improve this question






















  • so you know which changes are yours? if so you can cherry-pick

    – Bob
    Mar 7 at 22:11















1















My current repo is ahead of the repo I forked from. I was wondering, is there a way I can create a new branch off of master, pull in the files I changed, and create a PR from this branch?



The issue is I don't want to create a PR for all of my changes in master. For example, I have changes to:



src/
file1
file2
file3


from my master to theirs in my fork. I want to pull in all there changes, and then only send my changes to file2 in a PR.










share|improve this question






















  • so you know which changes are yours? if so you can cherry-pick

    – Bob
    Mar 7 at 22:11













1












1








1


1






My current repo is ahead of the repo I forked from. I was wondering, is there a way I can create a new branch off of master, pull in the files I changed, and create a PR from this branch?



The issue is I don't want to create a PR for all of my changes in master. For example, I have changes to:



src/
file1
file2
file3


from my master to theirs in my fork. I want to pull in all there changes, and then only send my changes to file2 in a PR.










share|improve this question














My current repo is ahead of the repo I forked from. I was wondering, is there a way I can create a new branch off of master, pull in the files I changed, and create a PR from this branch?



The issue is I don't want to create a PR for all of my changes in master. For example, I have changes to:



src/
file1
file2
file3


from my master to theirs in my fork. I want to pull in all there changes, and then only send my changes to file2 in a PR.







git






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Mar 7 at 21:29









RobRob

1,264929




1,264929












  • so you know which changes are yours? if so you can cherry-pick

    – Bob
    Mar 7 at 22:11

















  • so you know which changes are yours? if so you can cherry-pick

    – Bob
    Mar 7 at 22:11
















so you know which changes are yours? if so you can cherry-pick

– Bob
Mar 7 at 22:11





so you know which changes are yours? if so you can cherry-pick

– Bob
Mar 7 at 22:11












1 Answer
1






active

oldest

votes


















1














If you create a PR branch, create it from upstream/master (with upstream being the remote name for the original repo, that you have forked)



git remote add upstream /url/original/repo
git fetch upstream
git checkout -b mypr upstream/master


From then, as commented, you can cherry-pick your commits (or even ranges of commits)






share|improve this answer























    Your Answer






    StackExchange.ifUsing("editor", function ()
    StackExchange.using("externalEditor", function ()
    StackExchange.using("snippets", function ()
    StackExchange.snippets.init();
    );
    );
    , "code-snippets");

    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "1"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













    draft saved

    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55053070%2fcreate-pull-request-from-fork-with-only-certain-files%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    1














    If you create a PR branch, create it from upstream/master (with upstream being the remote name for the original repo, that you have forked)



    git remote add upstream /url/original/repo
    git fetch upstream
    git checkout -b mypr upstream/master


    From then, as commented, you can cherry-pick your commits (or even ranges of commits)






    share|improve this answer



























      1














      If you create a PR branch, create it from upstream/master (with upstream being the remote name for the original repo, that you have forked)



      git remote add upstream /url/original/repo
      git fetch upstream
      git checkout -b mypr upstream/master


      From then, as commented, you can cherry-pick your commits (or even ranges of commits)






      share|improve this answer

























        1












        1








        1







        If you create a PR branch, create it from upstream/master (with upstream being the remote name for the original repo, that you have forked)



        git remote add upstream /url/original/repo
        git fetch upstream
        git checkout -b mypr upstream/master


        From then, as commented, you can cherry-pick your commits (or even ranges of commits)






        share|improve this answer













        If you create a PR branch, create it from upstream/master (with upstream being the remote name for the original repo, that you have forked)



        git remote add upstream /url/original/repo
        git fetch upstream
        git checkout -b mypr upstream/master


        From then, as commented, you can cherry-pick your commits (or even ranges of commits)







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Mar 8 at 6:09









        VonCVonC

        852k30127143277




        852k30127143277





























            draft saved

            draft discarded
















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55053070%2fcreate-pull-request-from-fork-with-only-certain-files%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Save data to MySQL database using ExtJS and PHP [closed]2019 Community Moderator ElectionHow can I prevent SQL injection in PHP?Which MySQL data type to use for storing boolean valuesPHP: Delete an element from an arrayHow do I connect to a MySQL Database in Python?Should I use the datetime or timestamp data type in MySQL?How to get a list of MySQL user accountsHow Do You Parse and Process HTML/XML in PHP?Reference — What does this symbol mean in PHP?How does PHP 'foreach' actually work?Why shouldn't I use mysql_* functions in PHP?

            Compiling GNU Global with universal-ctags support Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern) Data science time! April 2019 and salary with experience The Ask Question Wizard is Live!Tags for Emacs: Relationship between etags, ebrowse, cscope, GNU Global and exuberant ctagsVim and Ctags tips and trickscscope or ctags why choose one over the other?scons and ctagsctags cannot open option file “.ctags”Adding tag scopes in universal-ctagsShould I use Universal-ctags?Universal ctags on WindowsHow do I install GNU Global with universal ctags support using Homebrew?Universal ctags with emacsHow to highlight ctags generated by Universal Ctags in Vim?

            Add ONERROR event to image from jsp tldHow to add an image to a JPanel?Saving image from PHP URLHTML img scalingCheck if an image is loaded (no errors) with jQueryHow to force an <img> to take up width, even if the image is not loadedHow do I populate hidden form field with a value set in Spring ControllerStyling Raw elements Generated from JSP tagds with Jquery MobileLimit resizing of images with explicitly set width and height attributeserror TLD use in a jsp fileJsp tld files cannot be resolved