Are there good techniques when manually merging code ?
-
Or just hope for the best or just re-write everything from scratch with the 2 versions on different screens for reference ? I added a new feature in my developement branch as part of some bigger changes (database) , I needed to backport it to main branch, and I improved it on the main branch. Now I have to merge it back to the development branch. lolz... :rolleyes: I just hope it compiles at this point and start fixing it !!
CI/CD = Continuous Impediment/Continuous Despair
If you are comparing code - I strongly STRONGLY recommend Beyond Compare. My coworker, mentor, boss sent me in this direction, and I never looked back. As far as the general process - full disclaimer I use SVN and Tortoise, so I cannot speak to what GIT does - doing a large merge should be off in a branch. Once you are done and happy, you can migrate it to the trunk. Using this approach, you have a retreat path. Feel free to do as many commits as you want on the branch to show your merge work. Better yet, have developer 1 and 2 commit their work on separate branches and merge those. Protect the trunk.
Charlie Gilley “They who can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety.” BF, 1759 Has never been more appropriate.
-
Or just hope for the best or just re-write everything from scratch with the 2 versions on different screens for reference ? I added a new feature in my developement branch as part of some bigger changes (database) , I needed to backport it to main branch, and I improved it on the main branch. Now I have to merge it back to the development branch. lolz... :rolleyes: I just hope it compiles at this point and start fixing it !!
CI/CD = Continuous Impediment/Continuous Despair
I use WinMerge for single files. Used to be much better before someone got the idea that when a directory on one side was empty that one should (must) show all the files on the other side. So now I also use BeyondCompare. Just need to figure out all of the rules to add every time I must install it fresh. And then I make sure I am very, very focused on figuring out the updates.
-
I use WinMerge for single files. Used to be much better before someone got the idea that when a directory on one side was empty that one should (must) show all the files on the other side. So now I also use BeyondCompare. Just need to figure out all of the rules to add every time I must install it fresh. And then I make sure I am very, very focused on figuring out the updates.
BC is legendary in my book. It even will show you what changed in images. now, if they could lock down comparing Excel files, I would die and go to heaven.
Charlie Gilley “They who can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety.” BF, 1759 Has never been more appropriate.
-
If you are comparing code - I strongly STRONGLY recommend Beyond Compare. My coworker, mentor, boss sent me in this direction, and I never looked back. As far as the general process - full disclaimer I use SVN and Tortoise, so I cannot speak to what GIT does - doing a large merge should be off in a branch. Once you are done and happy, you can migrate it to the trunk. Using this approach, you have a retreat path. Feel free to do as many commits as you want on the branch to show your merge work. Better yet, have developer 1 and 2 commit their work on separate branches and merge those. Protect the trunk.
Charlie Gilley “They who can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety.” BF, 1759 Has never been more appropriate.
Funny, I mentioned BC and no upvotes for me. Starting to think the people of this place aren't mature and rational. :laugh: :laugh: :laugh: Oh and thumbs up for mentioning BC.
Jeremy Falcon
-
BC is legendary in my book. It even will show you what changed in images. now, if they could lock down comparing Excel files, I would die and go to heaven.
Charlie Gilley “They who can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety.” BF, 1759 Has never been more appropriate.
charlieg wrote:
now, if they could lock down comparing Excel files, I would die and go to heaven.
Since Excel files are containers for multiple files, this would be like comparing two folders with added complications. In addition to there being multiple worksheets containing either grids or charts (and also charts on the grids), there's also highlighting, conditional rules, VBA macros, etc.. And that's before you consider how to actually display the difference between 2 versions of a worksheet, assuming they can be matched up when columns and rows may have been moved around, the worksheets have been renamed and moved into a different order... Checking if the value of one cell has changed or is now a formula or an inserted image is barely the beginning!
-
Funny, I mentioned BC and no upvotes for me. Starting to think the people of this place aren't mature and rational. :laugh: :laugh: :laugh: Oh and thumbs up for mentioning BC.
Jeremy Falcon
Jeremy Falcon wrote:
the people of this place aren't mature and rational.
Developers mature and rational? You must be from the alternate timeline! :D
Freedom is the freedom to say that two plus two make four. If that is granted, all else follows. -- 6079 Smith W.
-
Jeremy Falcon wrote:
the people of this place aren't mature and rational.
Developers mature and rational? You must be from the alternate timeline! :D
Freedom is the freedom to say that two plus two make four. If that is granted, all else follows. -- 6079 Smith W.
:laugh: :laugh: :laugh:
Jeremy Falcon
-
Jeremy Falcon wrote:
the people of this place aren't mature and rational.
Developers mature and rational? You must be from the alternate timeline! :D
Freedom is the freedom to say that two plus two make four. If that is granted, all else follows. -- 6079 Smith W.
Daniel Pfeffer wrote:
Developers mature and rational? You must be from the alternate timeline dimension!
FTFY
M.D.V. ;) If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about? Help me to understand what I'm saying, and I'll explain it better to you Rating helpful answers is nice, but saying thanks can be even nicer.
-
I use WinMerge for single files. Used to be much better before someone got the idea that when a directory on one side was empty that one should (must) show all the files on the other side. So now I also use BeyondCompare. Just need to figure out all of the rules to add every time I must install it fresh. And then I make sure I am very, very focused on figuring out the updates.
Was there not an export or save command for the rules?
M.D.V. ;) If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about? Help me to understand what I'm saying, and I'll explain it better to you Rating helpful answers is nice, but saying thanks can be even nicer.
-
Or just hope for the best or just re-write everything from scratch with the 2 versions on different screens for reference ? I added a new feature in my developement branch as part of some bigger changes (database) , I needed to backport it to main branch, and I improved it on the main branch. Now I have to merge it back to the development branch. lolz... :rolleyes: I just hope it compiles at this point and start fixing it !!
CI/CD = Continuous Impediment/Continuous Despair
I use `git rebase master` to put the branch's changes on top of the current version of master. You'll have to resolve conflicts just like with `git merge`. After you're finished, then use `git push --force-with-lease` to push your changes to your remote branch. (You might need to ask the repo administrator to grant you this permission, or push these changes to a new remote branch if that is not possible. The reason the permission might be denied is that force pushes rewrite history, so if two people are working on the same branch it can cause problems.)
-
If you are comparing code - I strongly STRONGLY recommend Beyond Compare. My coworker, mentor, boss sent me in this direction, and I never looked back. As far as the general process - full disclaimer I use SVN and Tortoise, so I cannot speak to what GIT does - doing a large merge should be off in a branch. Once you are done and happy, you can migrate it to the trunk. Using this approach, you have a retreat path. Feel free to do as many commits as you want on the branch to show your merge work. Better yet, have developer 1 and 2 commit their work on separate branches and merge those. Protect the trunk.
Charlie Gilley “They who can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety.” BF, 1759 Has never been more appropriate.
-
Can latest BC do a three-way diff/merge? (ie. diff 2 branches against a common ancestor) I think that's why I've stuck with Araxis Merge .. but may give latest BC a try again. Araxis costs $
-
charlieg wrote:
now, if they could lock down comparing Excel files, I would die and go to heaven.
Since Excel files are containers for multiple files, this would be like comparing two folders with added complications. In addition to there being multiple worksheets containing either grids or charts (and also charts on the grids), there's also highlighting, conditional rules, VBA macros, etc.. And that's before you consider how to actually display the difference between 2 versions of a worksheet, assuming they can be matched up when columns and rows may have been moved around, the worksheets have been renamed and moved into a different order... Checking if the value of one cell has changed or is now a formula or an inserted image is barely the beginning!
lol, I didn't say it would be easy. I get the difficulty. I could live with just textual changes.
Charlie Gilley “They who can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety.” BF, 1759 Has never been more appropriate.
-
Or just hope for the best or just re-write everything from scratch with the 2 versions on different screens for reference ? I added a new feature in my developement branch as part of some bigger changes (database) , I needed to backport it to main branch, and I improved it on the main branch. Now I have to merge it back to the development branch. lolz... :rolleyes: I just hope it compiles at this point and start fixing it !!
CI/CD = Continuous Impediment/Continuous Despair
One advanced technique -- maybe overkill for your scenario but sometimes necessary.. I had to do this recently -- use a tool like Araxis Merge to do a three-way diff/merge (compare 2 branches against a common ancestor). 1- use `git merge-base BranchA BranchB` to find common ancestor .. create a new branch BranchC off that commit 2- clone/checkout BranchA and BranchB in separate subdirectories 3- launch a three-way merge: A(left), C(center), B(right) .. manually merge stuff to BranchC 4- commit BranchC .. then merge those changes back up to BranchA and BranchB this will lose some commit-history from incremental changes in BranchA and BranchB.. vs cherry-picking from A to B then merging back to A but if those branches were messy and conflicting, then that commit-history might have been unintelligible anyway
-
Or just hope for the best or just re-write everything from scratch with the 2 versions on different screens for reference ? I added a new feature in my developement branch as part of some bigger changes (database) , I needed to backport it to main branch, and I improved it on the main branch. Now I have to merge it back to the development branch. lolz... :rolleyes: I just hope it compiles at this point and start fixing it !!
CI/CD = Continuous Impediment/Continuous Despair
The best technique I have found is what I do before I have to merge. I create my working branch from whatever “main” branch is “gold”. Every morning, I merge that main branch into my working branch to pick up any changes others pushed up. At worst, there is an occasional small manual merge affecting a line or two. Then, when I create my pull request to merge my working branch into that main branch, I don’t have merge conflicts. A little preventive medicine goes a long way.
-
charlieg wrote:
now, if they could lock down comparing Excel files, I would die and go to heaven.
Since Excel files are containers for multiple files, this would be like comparing two folders with added complications. In addition to there being multiple worksheets containing either grids or charts (and also charts on the grids), there's also highlighting, conditional rules, VBA macros, etc.. And that's before you consider how to actually display the difference between 2 versions of a worksheet, assuming they can be matched up when columns and rows may have been moved around, the worksheets have been renamed and moved into a different order... Checking if the value of one cell has changed or is now a formula or an inserted image is barely the beginning!