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

            1928 у кіно

            Захаров Федір Захарович

            Ель Греко