Git: fix noobish error to avoid hell brute force

I'm a little new to git and decided that I would jump right into it and not give myself the right tutorial. After a month of work on the project, I found it a bit difficult. At some point, I decided that I did not like how a particular piece of code was obtained, so at that moment B, I forked E, deleted the offending file and recreated it as a whole new file. Obviously, git rm would be best instead of just deleting the file ... Now I need to reinstall E to separate C, but I'm not sure how to do this, due to conflicts with rebase, as the file changes in both branches. My goal is basically to make the branch starting with E continue with the new file, but include the C changes in the new branch. Any help in determining how to handle this would be greatly appreciated.

A -> B -> C -> D \ E -> F -> G 
+4
source share
1 answer

Your final report tells me that what you are looking for is to merge a particular file in C or even better in D with the same file in G. So you will have a new file as you move from E to G including changes, contributed by you in C, which I believe are also in D.

It is possible to combine certain files between branches. Since I am not very experienced, I will refer to a couple of links that describe how you can do this:

http://jasonrudolph.com/blog/2009/02/25/git-tip-how-to-merge-specific-files-from-another-branch/

How to merge changes into a single file, rather than merging?

Hope this helps.

+2
source

Source: https://habr.com/ru/post/1444683/


All Articles