Search code examples
gitmergerebase

How can I merge branch B with branch A, without pulling from branch A first?


I'm not experienced with in depth git commands, but I know the basics I think.

so my use case is, I have a 'master' branch and a 'new' branch.

master branch has a lot of files, lets say 1000 files.

I would like to have a new branch with no files, and I would like to add files to the folder in this branch, lets say 10 files, and then I would like to add these 10 files to the master branch without first pulling from the master branch.

is this even possible? (right now I made a new branch called 'new' using 'master' and deleted all the files in 'new', but I don't think this will work)


Solution

  • I think, basically. there won't be exist a situation like you descibe. Because, when you create new branch from master branch, at new branch allways contain files of master branch (snapshot).

    Normally, we create local branch, remote branch with same name, which are distinguished by origin

    You should improve your basic git knowledge. Anyway, Don’t give up!