Git merge to branch merges files from previous merged branches












0















While merging into the master branch it merges files that are already merged in master via different branch



Master branch M
Feature branch f1,f2,f3



M <-f1
M<-f2
M<-f3


git clone http://test.com/test.git
git checkout M



Open file in PHPstorm .It asked to Open project .clicked on confirm



git checkout -b f1
git status
# it shows all file as modified even only file1 is updated


Open desired file file1 did the modification and saved it



git commit file1 -m 'f1 branch' 
git push -upstream f1
git checkout M
git merge f1


git log -1 --stat



shows only 1 file file1
it merges file1 git push.
The process is done properly but when tried same with branch f2.
it merges file1 and file2 same goes for push where I am going wrong.
But on each merge in master, it pushes previous branches files



Step where actual issue Occurs



git checkout -b f2



Open file2 in phpstorm modify and save the file




git status  


All files are shown as modified whereas only file2 was actually updated



git commit file2 -m 'test for f2'
git push -upstream f2
#push only file 2
git checkout M
git status
o/p Your branch M
your branch is ahead of 2 commits
git merge f2
#it merges file1 and file2
git push
#it pushes file1 and file2


My 2 questions:




  1. How to open the project that is under git repository via PHPstorm.
    Is it the main cause to show all files as modified

  2. What wrong i am doing in merge or is there any method to just merge few files and push only few files in main branch.


Had taken reference from How can I merge two branches without losing any files?



Have updated the question is it clear










share|improve this question

























  • It is really unclear what you are trying to do. Are you able to clarify your question?

    – Burgi
    Mar 1 at 11:30











  • Try to have a look why you're seeing every file as being modified. Check how you setup git to handle line endings, what PHPStorm uses and what's in the files after a checkout.

    – Seth
    Mar 1 at 12:14











  • @Burgi is it clear now? Actually, i am trying to merge different files from different branches to master. It worked well in first merge and push. But while merging the second branch it had merged files that were already merged in the previous branch.

    – insoftservice
    Mar 1 at 12:15













  • @Seth that's my question does phpstorm modifies the files. As i have just open the folder in it have not done any git settings as i don't know about it . Same if pulled on my colleagues laptop which has phpstorm has no issue.

    – insoftservice
    Mar 1 at 12:18











  • You are the one on the computer. You will have to compare those files. Nobody can do that for you. Especially since your git settings also matter and only you know how you set it up. Grab the file, do a checkout, grab it again and compare it with your favorite tool. Are they different? If so either your editor or git modifies the file.

    – Seth
    Mar 1 at 12:30
















0















While merging into the master branch it merges files that are already merged in master via different branch



Master branch M
Feature branch f1,f2,f3



M <-f1
M<-f2
M<-f3


git clone http://test.com/test.git
git checkout M



Open file in PHPstorm .It asked to Open project .clicked on confirm



git checkout -b f1
git status
# it shows all file as modified even only file1 is updated


Open desired file file1 did the modification and saved it



git commit file1 -m 'f1 branch' 
git push -upstream f1
git checkout M
git merge f1


git log -1 --stat



shows only 1 file file1
it merges file1 git push.
The process is done properly but when tried same with branch f2.
it merges file1 and file2 same goes for push where I am going wrong.
But on each merge in master, it pushes previous branches files



Step where actual issue Occurs



git checkout -b f2



Open file2 in phpstorm modify and save the file




git status  


All files are shown as modified whereas only file2 was actually updated



git commit file2 -m 'test for f2'
git push -upstream f2
#push only file 2
git checkout M
git status
o/p Your branch M
your branch is ahead of 2 commits
git merge f2
#it merges file1 and file2
git push
#it pushes file1 and file2


My 2 questions:




  1. How to open the project that is under git repository via PHPstorm.
    Is it the main cause to show all files as modified

  2. What wrong i am doing in merge or is there any method to just merge few files and push only few files in main branch.


Had taken reference from How can I merge two branches without losing any files?



Have updated the question is it clear










share|improve this question

























  • It is really unclear what you are trying to do. Are you able to clarify your question?

    – Burgi
    Mar 1 at 11:30











  • Try to have a look why you're seeing every file as being modified. Check how you setup git to handle line endings, what PHPStorm uses and what's in the files after a checkout.

    – Seth
    Mar 1 at 12:14











  • @Burgi is it clear now? Actually, i am trying to merge different files from different branches to master. It worked well in first merge and push. But while merging the second branch it had merged files that were already merged in the previous branch.

    – insoftservice
    Mar 1 at 12:15













  • @Seth that's my question does phpstorm modifies the files. As i have just open the folder in it have not done any git settings as i don't know about it . Same if pulled on my colleagues laptop which has phpstorm has no issue.

    – insoftservice
    Mar 1 at 12:18











  • You are the one on the computer. You will have to compare those files. Nobody can do that for you. Especially since your git settings also matter and only you know how you set it up. Grab the file, do a checkout, grab it again and compare it with your favorite tool. Are they different? If so either your editor or git modifies the file.

    – Seth
    Mar 1 at 12:30














0












0








0








While merging into the master branch it merges files that are already merged in master via different branch



Master branch M
Feature branch f1,f2,f3



M <-f1
M<-f2
M<-f3


git clone http://test.com/test.git
git checkout M



Open file in PHPstorm .It asked to Open project .clicked on confirm



git checkout -b f1
git status
# it shows all file as modified even only file1 is updated


Open desired file file1 did the modification and saved it



git commit file1 -m 'f1 branch' 
git push -upstream f1
git checkout M
git merge f1


git log -1 --stat



shows only 1 file file1
it merges file1 git push.
The process is done properly but when tried same with branch f2.
it merges file1 and file2 same goes for push where I am going wrong.
But on each merge in master, it pushes previous branches files



Step where actual issue Occurs



git checkout -b f2



Open file2 in phpstorm modify and save the file




git status  


All files are shown as modified whereas only file2 was actually updated



git commit file2 -m 'test for f2'
git push -upstream f2
#push only file 2
git checkout M
git status
o/p Your branch M
your branch is ahead of 2 commits
git merge f2
#it merges file1 and file2
git push
#it pushes file1 and file2


My 2 questions:




  1. How to open the project that is under git repository via PHPstorm.
    Is it the main cause to show all files as modified

  2. What wrong i am doing in merge or is there any method to just merge few files and push only few files in main branch.


Had taken reference from How can I merge two branches without losing any files?



Have updated the question is it clear










share|improve this question
















While merging into the master branch it merges files that are already merged in master via different branch



Master branch M
Feature branch f1,f2,f3



M <-f1
M<-f2
M<-f3


git clone http://test.com/test.git
git checkout M



Open file in PHPstorm .It asked to Open project .clicked on confirm



git checkout -b f1
git status
# it shows all file as modified even only file1 is updated


Open desired file file1 did the modification and saved it



git commit file1 -m 'f1 branch' 
git push -upstream f1
git checkout M
git merge f1


git log -1 --stat



shows only 1 file file1
it merges file1 git push.
The process is done properly but when tried same with branch f2.
it merges file1 and file2 same goes for push where I am going wrong.
But on each merge in master, it pushes previous branches files



Step where actual issue Occurs



git checkout -b f2



Open file2 in phpstorm modify and save the file




git status  


All files are shown as modified whereas only file2 was actually updated



git commit file2 -m 'test for f2'
git push -upstream f2
#push only file 2
git checkout M
git status
o/p Your branch M
your branch is ahead of 2 commits
git merge f2
#it merges file1 and file2
git push
#it pushes file1 and file2


My 2 questions:




  1. How to open the project that is under git repository via PHPstorm.
    Is it the main cause to show all files as modified

  2. What wrong i am doing in merge or is there any method to just merge few files and push only few files in main branch.


Had taken reference from How can I merge two branches without losing any files?



Have updated the question is it clear







git






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 6 at 15:57







insoftservice

















asked Mar 1 at 11:21









insoftserviceinsoftservice

1012




1012













  • It is really unclear what you are trying to do. Are you able to clarify your question?

    – Burgi
    Mar 1 at 11:30











  • Try to have a look why you're seeing every file as being modified. Check how you setup git to handle line endings, what PHPStorm uses and what's in the files after a checkout.

    – Seth
    Mar 1 at 12:14











  • @Burgi is it clear now? Actually, i am trying to merge different files from different branches to master. It worked well in first merge and push. But while merging the second branch it had merged files that were already merged in the previous branch.

    – insoftservice
    Mar 1 at 12:15













  • @Seth that's my question does phpstorm modifies the files. As i have just open the folder in it have not done any git settings as i don't know about it . Same if pulled on my colleagues laptop which has phpstorm has no issue.

    – insoftservice
    Mar 1 at 12:18











  • You are the one on the computer. You will have to compare those files. Nobody can do that for you. Especially since your git settings also matter and only you know how you set it up. Grab the file, do a checkout, grab it again and compare it with your favorite tool. Are they different? If so either your editor or git modifies the file.

    – Seth
    Mar 1 at 12:30



















  • It is really unclear what you are trying to do. Are you able to clarify your question?

    – Burgi
    Mar 1 at 11:30











  • Try to have a look why you're seeing every file as being modified. Check how you setup git to handle line endings, what PHPStorm uses and what's in the files after a checkout.

    – Seth
    Mar 1 at 12:14











  • @Burgi is it clear now? Actually, i am trying to merge different files from different branches to master. It worked well in first merge and push. But while merging the second branch it had merged files that were already merged in the previous branch.

    – insoftservice
    Mar 1 at 12:15













  • @Seth that's my question does phpstorm modifies the files. As i have just open the folder in it have not done any git settings as i don't know about it . Same if pulled on my colleagues laptop which has phpstorm has no issue.

    – insoftservice
    Mar 1 at 12:18











  • You are the one on the computer. You will have to compare those files. Nobody can do that for you. Especially since your git settings also matter and only you know how you set it up. Grab the file, do a checkout, grab it again and compare it with your favorite tool. Are they different? If so either your editor or git modifies the file.

    – Seth
    Mar 1 at 12:30

















It is really unclear what you are trying to do. Are you able to clarify your question?

– Burgi
Mar 1 at 11:30





It is really unclear what you are trying to do. Are you able to clarify your question?

– Burgi
Mar 1 at 11:30













Try to have a look why you're seeing every file as being modified. Check how you setup git to handle line endings, what PHPStorm uses and what's in the files after a checkout.

– Seth
Mar 1 at 12:14





Try to have a look why you're seeing every file as being modified. Check how you setup git to handle line endings, what PHPStorm uses and what's in the files after a checkout.

– Seth
Mar 1 at 12:14













@Burgi is it clear now? Actually, i am trying to merge different files from different branches to master. It worked well in first merge and push. But while merging the second branch it had merged files that were already merged in the previous branch.

– insoftservice
Mar 1 at 12:15







@Burgi is it clear now? Actually, i am trying to merge different files from different branches to master. It worked well in first merge and push. But while merging the second branch it had merged files that were already merged in the previous branch.

– insoftservice
Mar 1 at 12:15















@Seth that's my question does phpstorm modifies the files. As i have just open the folder in it have not done any git settings as i don't know about it . Same if pulled on my colleagues laptop which has phpstorm has no issue.

– insoftservice
Mar 1 at 12:18





@Seth that's my question does phpstorm modifies the files. As i have just open the folder in it have not done any git settings as i don't know about it . Same if pulled on my colleagues laptop which has phpstorm has no issue.

– insoftservice
Mar 1 at 12:18













You are the one on the computer. You will have to compare those files. Nobody can do that for you. Especially since your git settings also matter and only you know how you set it up. Grab the file, do a checkout, grab it again and compare it with your favorite tool. Are they different? If so either your editor or git modifies the file.

– Seth
Mar 1 at 12:30





You are the one on the computer. You will have to compare those files. Nobody can do that for you. Especially since your git settings also matter and only you know how you set it up. Grab the file, do a checkout, grab it again and compare it with your favorite tool. Are they different? If so either your editor or git modifies the file.

– Seth
Mar 1 at 12:30










0






active

oldest

votes












Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "3"
};
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%2fsuperuser.com%2fquestions%2f1410441%2fgit-merge-to-branch-merges-files-from-previous-merged-branches%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes
















draft saved

draft discarded




















































Thanks for contributing an answer to Super User!


  • 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%2fsuperuser.com%2fquestions%2f1410441%2fgit-merge-to-branch-merges-files-from-previous-merged-branches%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

How do I know what Microsoft account the skydrive app is syncing to?

When does type information flow backwards in C++?

Grease: Live!