New developer can't keep up with branch merges



.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty margin-bottom:0;







up vote
61
down vote

favorite
9












I am the new developer - this is my first programming position.



My issue is this: We use git - I cut a branch from our develop branch, then I start working on the minor task I've been assigned. It's very slow, because I'm inexperienced. By the time I'm ready to merge my branch back into develop the others have made so many changes that resolving the conflicts is overwhelming (it actually seems easier to scrap my work and start over on the task, which of course is not a sustainable solution).



How do I overcome this? Is there a tactic I can use other than 'be better at coding'? I intend to bring this up with my supervisor next week.







share|improve this question













migrated from workplace.stackexchange.com yesterday


This question came from our site for members of the workforce navigating the professional setting.










  • 47




    you dont need to only merge your branch into develop only when you are finished. you can merge develop into your feature branch incrementally whenever you like, to make the final merge smaller.
    – DavidB
    yesterday






  • 3




    Be sure you're doing the merging process right. Only your files should be affected and only your changes should be applied to the dev branch. If you're getting random conflicts, chances are you done the merge wrong or others are messing up the revision order. It's a good chance to educate yourself and possibly others in merging right. Some folks have a hard time understanding it's changes, not files that are being merged. So revisions ordering out of sync would cause conflicts on files you never touched.
    – Dan
    yesterday






  • 5




    Also be sure your editor is set right. Sometimes editors "fixes" tabs and spaces so when you edit a file, and attempt to commit back, it changes the entire file. You should make sure before committing that only your changes are being committed to the branch and fix your editor.
    – Dan
    yesterday






  • 10




    There is one odd thing here "I start working on the minor task " and tons of merge conflicts normally do not match. I just merged a 2 week major update branch into an experimental development and we had 10 (!) conflicts that were not auto-resolvable. You do not get tons of conflicts unless your task is "change variable names over all files". Not for MINOR tasks.
    – TomTom
    yesterday






  • 6




    Obligatory xkcd: xkcd.com/1597
    – E.D.
    yesterday
















up vote
61
down vote

favorite
9












I am the new developer - this is my first programming position.



My issue is this: We use git - I cut a branch from our develop branch, then I start working on the minor task I've been assigned. It's very slow, because I'm inexperienced. By the time I'm ready to merge my branch back into develop the others have made so many changes that resolving the conflicts is overwhelming (it actually seems easier to scrap my work and start over on the task, which of course is not a sustainable solution).



How do I overcome this? Is there a tactic I can use other than 'be better at coding'? I intend to bring this up with my supervisor next week.







share|improve this question













migrated from workplace.stackexchange.com yesterday


This question came from our site for members of the workforce navigating the professional setting.










  • 47




    you dont need to only merge your branch into develop only when you are finished. you can merge develop into your feature branch incrementally whenever you like, to make the final merge smaller.
    – DavidB
    yesterday






  • 3




    Be sure you're doing the merging process right. Only your files should be affected and only your changes should be applied to the dev branch. If you're getting random conflicts, chances are you done the merge wrong or others are messing up the revision order. It's a good chance to educate yourself and possibly others in merging right. Some folks have a hard time understanding it's changes, not files that are being merged. So revisions ordering out of sync would cause conflicts on files you never touched.
    – Dan
    yesterday






  • 5




    Also be sure your editor is set right. Sometimes editors "fixes" tabs and spaces so when you edit a file, and attempt to commit back, it changes the entire file. You should make sure before committing that only your changes are being committed to the branch and fix your editor.
    – Dan
    yesterday






  • 10




    There is one odd thing here "I start working on the minor task " and tons of merge conflicts normally do not match. I just merged a 2 week major update branch into an experimental development and we had 10 (!) conflicts that were not auto-resolvable. You do not get tons of conflicts unless your task is "change variable names over all files". Not for MINOR tasks.
    – TomTom
    yesterday






  • 6




    Obligatory xkcd: xkcd.com/1597
    – E.D.
    yesterday












up vote
61
down vote

favorite
9









up vote
61
down vote

favorite
9






9





I am the new developer - this is my first programming position.



My issue is this: We use git - I cut a branch from our develop branch, then I start working on the minor task I've been assigned. It's very slow, because I'm inexperienced. By the time I'm ready to merge my branch back into develop the others have made so many changes that resolving the conflicts is overwhelming (it actually seems easier to scrap my work and start over on the task, which of course is not a sustainable solution).



How do I overcome this? Is there a tactic I can use other than 'be better at coding'? I intend to bring this up with my supervisor next week.







share|improve this question













I am the new developer - this is my first programming position.



My issue is this: We use git - I cut a branch from our develop branch, then I start working on the minor task I've been assigned. It's very slow, because I'm inexperienced. By the time I'm ready to merge my branch back into develop the others have made so many changes that resolving the conflicts is overwhelming (it actually seems easier to scrap my work and start over on the task, which of course is not a sustainable solution).



How do I overcome this? Is there a tactic I can use other than 'be better at coding'? I intend to bring this up with my supervisor next week.









share|improve this question












share|improve this question




share|improve this question








edited yesterday









Christophe

20k21854




20k21854









asked yesterday









daisy

42025




42025




migrated from workplace.stackexchange.com yesterday


This question came from our site for members of the workforce navigating the professional setting.






migrated from workplace.stackexchange.com yesterday


This question came from our site for members of the workforce navigating the professional setting.









  • 47




    you dont need to only merge your branch into develop only when you are finished. you can merge develop into your feature branch incrementally whenever you like, to make the final merge smaller.
    – DavidB
    yesterday






  • 3




    Be sure you're doing the merging process right. Only your files should be affected and only your changes should be applied to the dev branch. If you're getting random conflicts, chances are you done the merge wrong or others are messing up the revision order. It's a good chance to educate yourself and possibly others in merging right. Some folks have a hard time understanding it's changes, not files that are being merged. So revisions ordering out of sync would cause conflicts on files you never touched.
    – Dan
    yesterday






  • 5




    Also be sure your editor is set right. Sometimes editors "fixes" tabs and spaces so when you edit a file, and attempt to commit back, it changes the entire file. You should make sure before committing that only your changes are being committed to the branch and fix your editor.
    – Dan
    yesterday






  • 10




    There is one odd thing here "I start working on the minor task " and tons of merge conflicts normally do not match. I just merged a 2 week major update branch into an experimental development and we had 10 (!) conflicts that were not auto-resolvable. You do not get tons of conflicts unless your task is "change variable names over all files". Not for MINOR tasks.
    – TomTom
    yesterday






  • 6




    Obligatory xkcd: xkcd.com/1597
    – E.D.
    yesterday












  • 47




    you dont need to only merge your branch into develop only when you are finished. you can merge develop into your feature branch incrementally whenever you like, to make the final merge smaller.
    – DavidB
    yesterday






  • 3




    Be sure you're doing the merging process right. Only your files should be affected and only your changes should be applied to the dev branch. If you're getting random conflicts, chances are you done the merge wrong or others are messing up the revision order. It's a good chance to educate yourself and possibly others in merging right. Some folks have a hard time understanding it's changes, not files that are being merged. So revisions ordering out of sync would cause conflicts on files you never touched.
    – Dan
    yesterday






  • 5




    Also be sure your editor is set right. Sometimes editors "fixes" tabs and spaces so when you edit a file, and attempt to commit back, it changes the entire file. You should make sure before committing that only your changes are being committed to the branch and fix your editor.
    – Dan
    yesterday






  • 10




    There is one odd thing here "I start working on the minor task " and tons of merge conflicts normally do not match. I just merged a 2 week major update branch into an experimental development and we had 10 (!) conflicts that were not auto-resolvable. You do not get tons of conflicts unless your task is "change variable names over all files". Not for MINOR tasks.
    – TomTom
    yesterday






  • 6




    Obligatory xkcd: xkcd.com/1597
    – E.D.
    yesterday







47




47




you dont need to only merge your branch into develop only when you are finished. you can merge develop into your feature branch incrementally whenever you like, to make the final merge smaller.
– DavidB
yesterday




you dont need to only merge your branch into develop only when you are finished. you can merge develop into your feature branch incrementally whenever you like, to make the final merge smaller.
– DavidB
yesterday




3




3




Be sure you're doing the merging process right. Only your files should be affected and only your changes should be applied to the dev branch. If you're getting random conflicts, chances are you done the merge wrong or others are messing up the revision order. It's a good chance to educate yourself and possibly others in merging right. Some folks have a hard time understanding it's changes, not files that are being merged. So revisions ordering out of sync would cause conflicts on files you never touched.
– Dan
yesterday




Be sure you're doing the merging process right. Only your files should be affected and only your changes should be applied to the dev branch. If you're getting random conflicts, chances are you done the merge wrong or others are messing up the revision order. It's a good chance to educate yourself and possibly others in merging right. Some folks have a hard time understanding it's changes, not files that are being merged. So revisions ordering out of sync would cause conflicts on files you never touched.
– Dan
yesterday




5




5




Also be sure your editor is set right. Sometimes editors "fixes" tabs and spaces so when you edit a file, and attempt to commit back, it changes the entire file. You should make sure before committing that only your changes are being committed to the branch and fix your editor.
– Dan
yesterday




Also be sure your editor is set right. Sometimes editors "fixes" tabs and spaces so when you edit a file, and attempt to commit back, it changes the entire file. You should make sure before committing that only your changes are being committed to the branch and fix your editor.
– Dan
yesterday




10




10




There is one odd thing here "I start working on the minor task " and tons of merge conflicts normally do not match. I just merged a 2 week major update branch into an experimental development and we had 10 (!) conflicts that were not auto-resolvable. You do not get tons of conflicts unless your task is "change variable names over all files". Not for MINOR tasks.
– TomTom
yesterday




There is one odd thing here "I start working on the minor task " and tons of merge conflicts normally do not match. I just merged a 2 week major update branch into an experimental development and we had 10 (!) conflicts that were not auto-resolvable. You do not get tons of conflicts unless your task is "change variable names over all files". Not for MINOR tasks.
– TomTom
yesterday




6




6




Obligatory xkcd: xkcd.com/1597
– E.D.
yesterday




Obligatory xkcd: xkcd.com/1597
– E.D.
yesterday










7 Answers
7






active

oldest

votes

















up vote
106
down vote



accepted










I assume you're using git. If so, make use of git rebase -i (the -i means interactive). Make it a daily task (even more frequently, if necessary) to rebase your branch against the develop branch. This brings in the changes incrementally every day (at least) to keep your feature branch up-to-date. If there are conflicts during your daily rebase, you need to have a talk with your team about who's working on what.



If you run it daily, you probably won't need the interactive part. Just let it do its thing.



I'm a fairly experienced developer, and it still takes me quite a bit of time to get up to speed on a new project. In your case, it sounds like you have several people working on the same project simultaneously, so it's either a very large project, or a new project that's evolving quickly. In either case, don't be worried if it takes you several months to get into the flow. If I switch projects for 2 or 3 weeks and then switch back, it can take me a few hours (or even a day or two) to get fully "back into" a project that I wrote 100% on my own!



In short, don't worry about being slow right now. The way to get better is to just keep practicing. Don't be afraid to ask other developers about aspects of the projects you don't understand.






share|improve this answer



















  • 6




    I guess this is the correct answer, but, IMO, just another example of bad Git design and terminology. Just what are you "rebasing"? Shouldn't this be called "update" or "checkout" or "merge" or some such??? (An answer below argues for "fetch") What's the point of source code control if every day you are forced to update???
    – user949300
    yesterday







  • 24




    It isn't updating or checking out though. It's taking whatever is exclusively in your branch, and adding your changes as if you just now made them on the other branch. I.e. your changes are now "based on" the other branch. Furthermore, there does not exist any magical source control system that knows your code and can know how to merge changes when multiple people modify the same files. You update every day to keep the conflicts small and manageable, and the changes fresh in everyone's minds so they know how to handle them.
    – Vectorjohn
    yesterday







  • 9




    @user949300 rebasing is distinct from merging, is much more nuanced and requires a better understanding of Git than a simple merge workflow. That's why I never recommend a workflow involving rebasing to a Git novice, because it leads to the assumption that rebasing is the only/default way to update a branch and leads to lots of unnecessary pitfalls and pain. In this case, merging will solve the problem in the same way and neither will solve the problem of merge conflicts in two long-running parallel feature branches.
    – Ant P
    yesterday







  • 4




    @AntP You're probably right about merging being the better option here, especially for a new user. Sometimes I merge, sometimes I rebase...depends on the circumstances.
    – Jacob Robbins
    yesterday






  • 5




    @user949300 git pull which is just a combination of git fetch and git merge (or you can add --rebase to do a rebase instead of a merge). Assuming you're only about a day behind, then on a LAN this will likely complete in less than second, it might take a couple seconds over the internet. Even over the internet and with minor merge conflicts, you can typically be up-to-date and merged cleanly in less than a minute. Spending five minutes spread throughout the week is a lot better than spending an hour at the end of week dealing with a gnarly merge conflict.
    – Derek Elkins
    yesterday

















up vote
41
down vote













This might be a sign of bad software engineering on the company's part. Too many inter dependencies, different issues with overlapping features, attempting to tackle issues in the wrong order etc. can cause the situation you are describing. I suggest regularly merging develop into your branch during development






share|improve this answer

















  • 2




    This is coding 101 stuff as you mentioned. Not necessarily an accurate reflection on the new employee.
    – Mister Positive
    yesterday






  • 1




    @Ivan Anatolievich OP says that they're branched off of develop, not master, FYI
    – Matthew FitzGerald-Chamberlain
    yesterday

















up vote
28
down vote













The accepted answers I think are more of a technical "how to use Git better" nature, I think this is more of a team problem than an engineering or tooling problem.



If you're encountering a lot of merge conflicts it means that you and someone else on the team are stepping on each others toes.

You or they should aim to develop personal space while coding and avoid working in areas that are busy already.



In my team, we tend towards a high degree of task-ownership.

I'll usually take full and complete ownership of two or three files at a time and work on them in a branch for a day or two at most.

Typically if anyone else touches those files it's only if absolutely necessary for their own tasks, we generally don't work together on the same block of tasks at all!



If you're finding that you have to merge a lot at all then either all your teams code is in one place (which is something to avoid in itself) or all your tasks are.



All that said, as a new dev you're probably not in a position to enforce, request or even really suggest any sort of restructuring.

What I'd expect is that your tasks have been assigned as "learn-the-ropes" stuff that should be reasonably approachable at your skill level in order to ease you into the team. They've probably been culled from the tasks of a co-worker who is still working in the same area, hence your merge conflicts.

The solution to this then is to plug away at it, solve the problems, deal with the merge conflicts as best you can and don't worry too much, as long as you're doing your best it's down to your manager to worry about your progress.

You'll get faster and more confident as you go, and your co-workers will give you more autonomy and get in your way less as a consequence.






share|improve this answer

















  • 1




    I think you hit the nail on the head with the co-worker conflict. Merge conflicts are a regular thing, but they are generally limited to a handful of files.
    – Matthieu M.
    yesterday










  • Yesterday I dealt with just three minor merge conflicts. just a function I'd put in place with an input variable, and then the other guy had removed the need for that variable. That's the kind of problems we encounter as a well-delineated team. If you have to replace a whole line or weigh up which block of code is "correct" then something has gone pretty wrong. God forbid you have hundreds of tiny problems throughout the file. That's usually more of an auto-formatting problem. Setting up Visual Studio to handle it consistently solves that completely.
    – Ruadhan2300
    yesterday






  • 2




    This sounds like a corollary to Conway's Law, and the Single responsibility principle -- i.e. that if people are working on different problems then ideally they'll be editing separate parts of the source code.
    – ChrisW
    yesterday










  • @ChrisW Ideally. OP doesn't say whether the project is a tangled mess. (And being new, may not know the difference.)
    – TKK
    yesterday






  • 2




    While I agree that a poor process or poor design can lead to a large amount of conflicts, I'm pretty confident that the issue is simply that the OP isn't merging in the mainline regularly. I don't agree that "taking full and complete ownership" of files is appropriate as a matter of course. I don't want my team having a constant overhead of keeping track of who "owns" what now, asking "permission" to make changes, or guessing what files they should "claim". Only rarely, when significantly rewriting a component, have I asked team members to inform me if they were going to change certain files.
    – Derek Elkins
    yesterday

















up vote
4
down vote













The most important thing about merging is that the longer you wait, the more painful it gets. And the problem grows more than linear. Three times as many conflicts are nine times as much work. There are some strategies:



Merge with the development branch whenever it changes, so you are always close to it, and never have a huge number of conflicts.



If you take a long time, then it may be because you spend most of the time figuring out what the changes are, and then a small amount of time implementing the changes. If that is the case, merge with the development branch before you start actual code changes.



Talk to your colleagues about strategies to avoid conflicts. You get conflicts if two people edit the same code. Not just the same file, but the same code. So I need a new function functionA and you need a new function functionB, and we both add it at the end of the same file, we have a conflict. If we add it in different places, no conflict. If we both add it at a place in the file where it logically belongs, chances are we have no conflict.



If you have conflicts, get a good diff tool, so you can compare the develop branch before your merge, your code before the merge, your original code, and the merged code, and merge by hand.



Worst case: You don't throw your work away, but use a good diff tool to find out exactly what changes you made, branch again from develop, and apply all the changes you made manually instead of retyping them.






share|improve this answer




























    up vote
    3
    down vote













    You should run regularly (daily) the command 'git fetch' (not git pull) from your development branch. This will get other peoples committed changes and bring them into your feature branch without attempting to integrate the changes into your branch.



    This is something you should talk to the lead developer about (not necessarily your manager), because your company may have their own standards or recommended ways of handling this issue; it's very common. Don't wait until next week - find out the process now, and ask if you can commit some trivial work (such as code formatting or adding comments) so you can test the process.






    share|improve this answer

















    • 16




      I'm not sure this is correct. Git fetch will get remotes/origin/master up to date but you then need to merge remotes/origin/master into your feature branch (Or remotes/origin/develop if that's the flow they are using)
      – Richard Tingle
      yesterday










    • Assuming he's using git, it's also a good idea to learn how to squash your commit to meaningful parts. That way when you're ready to make a pull request, your commit is lean and straightforward and easy to understand.
      – Dan
      yesterday










    • @RichardTingle Correct, He's thinking of a rebase option. You simply fetch & rebase your branch with the dev branch. That will sync up everything.
      – Dan
      yesterday






    • 5




      @Dan I think that may be a matter of opinion. Personally I hate massive commits. Try git bisecting that!
      – Richard Tingle
      yesterday










    • @PeteCon "and bring them into your feature branch without attempting to integrate the changes into your branch". That seems like a contradictory statement. I think you mean bring them into your local repository without integrating them into your feature branch, but I'm not sure how that helps...
      – Jason Goemaat
      1 hour ago

















    up vote
    2
    down vote













    First, don't think about discarding your changes. You will loose opportunities to learn merge process.



    Second, find person who worked on files causing conflict. You can see history. Talk to person and resolve conflicts in that files. Do same for other conflicts.



    If it's too many conflicts, your task may be a minor but repetitive. Try to find pattern. This would help in resolving conflicts by git UI client tools. I use TortoiseGit. It helps in merge.



    And for avoiding in future,



    -it's a very good practice to merge develop branch regularly to your feature branch.



    -If you have CI enabled, see if CI tool provide branch build. This should build on every check in you make in your feature branch but after merge develop branch.





    share




























      up vote
      0
      down vote













      You get merge conflicts if the changes you did in your branch are near the changes your colleagues did in the develop branch in the meantime, that is, if you and your colleagues changed the same lines of code or adjacent lines in the same file.



      So to reduce the likelihood of merge conflicts, you can try to merge earlier so that your colleagues changed fewer lines in the meantime, or you can try to change fewer lines yourself.



      To change fewer lines yourself, make sure to only make changes related to your task.



      If you need to experiment with different ways to achieve your goal, maybe some of your experiments changed lines that don't really need to be changed? Undo these changes before merging.



      There are also some Git commands that can help you change as few lines as possible:




      • git diff and git diff --staged to see which lines you changed.


      • git add -p to only add some of your changes in a file.


      • git commit --amend and git rebase -i to tweak commits you already made in your local feature branch before pushing them to other Git repositories.

      (Changing as few lines as possible can also make it easier to review your work or to use tools that work on the differences between commits such as git cherry-pick, git rebase, git bisect, and git blame.)



      But even if you reduce the likelihood of merge conflicts, you will still run into merge conflicts sometimes. So don't be afraid of them, but learn how to resolve the conflicts.






      share|improve this answer






















        protected by gnat 13 hours ago



        Thank you for your interest in this question.
        Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).



        Would you like to answer one of these unanswered questions instead?














        7 Answers
        7






        active

        oldest

        votes








        7 Answers
        7






        active

        oldest

        votes









        active

        oldest

        votes






        active

        oldest

        votes








        up vote
        106
        down vote



        accepted










        I assume you're using git. If so, make use of git rebase -i (the -i means interactive). Make it a daily task (even more frequently, if necessary) to rebase your branch against the develop branch. This brings in the changes incrementally every day (at least) to keep your feature branch up-to-date. If there are conflicts during your daily rebase, you need to have a talk with your team about who's working on what.



        If you run it daily, you probably won't need the interactive part. Just let it do its thing.



        I'm a fairly experienced developer, and it still takes me quite a bit of time to get up to speed on a new project. In your case, it sounds like you have several people working on the same project simultaneously, so it's either a very large project, or a new project that's evolving quickly. In either case, don't be worried if it takes you several months to get into the flow. If I switch projects for 2 or 3 weeks and then switch back, it can take me a few hours (or even a day or two) to get fully "back into" a project that I wrote 100% on my own!



        In short, don't worry about being slow right now. The way to get better is to just keep practicing. Don't be afraid to ask other developers about aspects of the projects you don't understand.






        share|improve this answer



















        • 6




          I guess this is the correct answer, but, IMO, just another example of bad Git design and terminology. Just what are you "rebasing"? Shouldn't this be called "update" or "checkout" or "merge" or some such??? (An answer below argues for "fetch") What's the point of source code control if every day you are forced to update???
          – user949300
          yesterday







        • 24




          It isn't updating or checking out though. It's taking whatever is exclusively in your branch, and adding your changes as if you just now made them on the other branch. I.e. your changes are now "based on" the other branch. Furthermore, there does not exist any magical source control system that knows your code and can know how to merge changes when multiple people modify the same files. You update every day to keep the conflicts small and manageable, and the changes fresh in everyone's minds so they know how to handle them.
          – Vectorjohn
          yesterday







        • 9




          @user949300 rebasing is distinct from merging, is much more nuanced and requires a better understanding of Git than a simple merge workflow. That's why I never recommend a workflow involving rebasing to a Git novice, because it leads to the assumption that rebasing is the only/default way to update a branch and leads to lots of unnecessary pitfalls and pain. In this case, merging will solve the problem in the same way and neither will solve the problem of merge conflicts in two long-running parallel feature branches.
          – Ant P
          yesterday







        • 4




          @AntP You're probably right about merging being the better option here, especially for a new user. Sometimes I merge, sometimes I rebase...depends on the circumstances.
          – Jacob Robbins
          yesterday






        • 5




          @user949300 git pull which is just a combination of git fetch and git merge (or you can add --rebase to do a rebase instead of a merge). Assuming you're only about a day behind, then on a LAN this will likely complete in less than second, it might take a couple seconds over the internet. Even over the internet and with minor merge conflicts, you can typically be up-to-date and merged cleanly in less than a minute. Spending five minutes spread throughout the week is a lot better than spending an hour at the end of week dealing with a gnarly merge conflict.
          – Derek Elkins
          yesterday














        up vote
        106
        down vote



        accepted










        I assume you're using git. If so, make use of git rebase -i (the -i means interactive). Make it a daily task (even more frequently, if necessary) to rebase your branch against the develop branch. This brings in the changes incrementally every day (at least) to keep your feature branch up-to-date. If there are conflicts during your daily rebase, you need to have a talk with your team about who's working on what.



        If you run it daily, you probably won't need the interactive part. Just let it do its thing.



        I'm a fairly experienced developer, and it still takes me quite a bit of time to get up to speed on a new project. In your case, it sounds like you have several people working on the same project simultaneously, so it's either a very large project, or a new project that's evolving quickly. In either case, don't be worried if it takes you several months to get into the flow. If I switch projects for 2 or 3 weeks and then switch back, it can take me a few hours (or even a day or two) to get fully "back into" a project that I wrote 100% on my own!



        In short, don't worry about being slow right now. The way to get better is to just keep practicing. Don't be afraid to ask other developers about aspects of the projects you don't understand.






        share|improve this answer



















        • 6




          I guess this is the correct answer, but, IMO, just another example of bad Git design and terminology. Just what are you "rebasing"? Shouldn't this be called "update" or "checkout" or "merge" or some such??? (An answer below argues for "fetch") What's the point of source code control if every day you are forced to update???
          – user949300
          yesterday







        • 24




          It isn't updating or checking out though. It's taking whatever is exclusively in your branch, and adding your changes as if you just now made them on the other branch. I.e. your changes are now "based on" the other branch. Furthermore, there does not exist any magical source control system that knows your code and can know how to merge changes when multiple people modify the same files. You update every day to keep the conflicts small and manageable, and the changes fresh in everyone's minds so they know how to handle them.
          – Vectorjohn
          yesterday







        • 9




          @user949300 rebasing is distinct from merging, is much more nuanced and requires a better understanding of Git than a simple merge workflow. That's why I never recommend a workflow involving rebasing to a Git novice, because it leads to the assumption that rebasing is the only/default way to update a branch and leads to lots of unnecessary pitfalls and pain. In this case, merging will solve the problem in the same way and neither will solve the problem of merge conflicts in two long-running parallel feature branches.
          – Ant P
          yesterday







        • 4




          @AntP You're probably right about merging being the better option here, especially for a new user. Sometimes I merge, sometimes I rebase...depends on the circumstances.
          – Jacob Robbins
          yesterday






        • 5




          @user949300 git pull which is just a combination of git fetch and git merge (or you can add --rebase to do a rebase instead of a merge). Assuming you're only about a day behind, then on a LAN this will likely complete in less than second, it might take a couple seconds over the internet. Even over the internet and with minor merge conflicts, you can typically be up-to-date and merged cleanly in less than a minute. Spending five minutes spread throughout the week is a lot better than spending an hour at the end of week dealing with a gnarly merge conflict.
          – Derek Elkins
          yesterday












        up vote
        106
        down vote



        accepted







        up vote
        106
        down vote



        accepted






        I assume you're using git. If so, make use of git rebase -i (the -i means interactive). Make it a daily task (even more frequently, if necessary) to rebase your branch against the develop branch. This brings in the changes incrementally every day (at least) to keep your feature branch up-to-date. If there are conflicts during your daily rebase, you need to have a talk with your team about who's working on what.



        If you run it daily, you probably won't need the interactive part. Just let it do its thing.



        I'm a fairly experienced developer, and it still takes me quite a bit of time to get up to speed on a new project. In your case, it sounds like you have several people working on the same project simultaneously, so it's either a very large project, or a new project that's evolving quickly. In either case, don't be worried if it takes you several months to get into the flow. If I switch projects for 2 or 3 weeks and then switch back, it can take me a few hours (or even a day or two) to get fully "back into" a project that I wrote 100% on my own!



        In short, don't worry about being slow right now. The way to get better is to just keep practicing. Don't be afraid to ask other developers about aspects of the projects you don't understand.






        share|improve this answer















        I assume you're using git. If so, make use of git rebase -i (the -i means interactive). Make it a daily task (even more frequently, if necessary) to rebase your branch against the develop branch. This brings in the changes incrementally every day (at least) to keep your feature branch up-to-date. If there are conflicts during your daily rebase, you need to have a talk with your team about who's working on what.



        If you run it daily, you probably won't need the interactive part. Just let it do its thing.



        I'm a fairly experienced developer, and it still takes me quite a bit of time to get up to speed on a new project. In your case, it sounds like you have several people working on the same project simultaneously, so it's either a very large project, or a new project that's evolving quickly. In either case, don't be worried if it takes you several months to get into the flow. If I switch projects for 2 or 3 weeks and then switch back, it can take me a few hours (or even a day or two) to get fully "back into" a project that I wrote 100% on my own!



        In short, don't worry about being slow right now. The way to get better is to just keep practicing. Don't be afraid to ask other developers about aspects of the projects you don't understand.







        share|improve this answer















        share|improve this answer



        share|improve this answer








        edited yesterday









        Robert Harvey

        161k39368578




        161k39368578











        answered yesterday









        Jacob Robbins

        536144




        536144







        • 6




          I guess this is the correct answer, but, IMO, just another example of bad Git design and terminology. Just what are you "rebasing"? Shouldn't this be called "update" or "checkout" or "merge" or some such??? (An answer below argues for "fetch") What's the point of source code control if every day you are forced to update???
          – user949300
          yesterday







        • 24




          It isn't updating or checking out though. It's taking whatever is exclusively in your branch, and adding your changes as if you just now made them on the other branch. I.e. your changes are now "based on" the other branch. Furthermore, there does not exist any magical source control system that knows your code and can know how to merge changes when multiple people modify the same files. You update every day to keep the conflicts small and manageable, and the changes fresh in everyone's minds so they know how to handle them.
          – Vectorjohn
          yesterday







        • 9




          @user949300 rebasing is distinct from merging, is much more nuanced and requires a better understanding of Git than a simple merge workflow. That's why I never recommend a workflow involving rebasing to a Git novice, because it leads to the assumption that rebasing is the only/default way to update a branch and leads to lots of unnecessary pitfalls and pain. In this case, merging will solve the problem in the same way and neither will solve the problem of merge conflicts in two long-running parallel feature branches.
          – Ant P
          yesterday







        • 4




          @AntP You're probably right about merging being the better option here, especially for a new user. Sometimes I merge, sometimes I rebase...depends on the circumstances.
          – Jacob Robbins
          yesterday






        • 5




          @user949300 git pull which is just a combination of git fetch and git merge (or you can add --rebase to do a rebase instead of a merge). Assuming you're only about a day behind, then on a LAN this will likely complete in less than second, it might take a couple seconds over the internet. Even over the internet and with minor merge conflicts, you can typically be up-to-date and merged cleanly in less than a minute. Spending five minutes spread throughout the week is a lot better than spending an hour at the end of week dealing with a gnarly merge conflict.
          – Derek Elkins
          yesterday












        • 6




          I guess this is the correct answer, but, IMO, just another example of bad Git design and terminology. Just what are you "rebasing"? Shouldn't this be called "update" or "checkout" or "merge" or some such??? (An answer below argues for "fetch") What's the point of source code control if every day you are forced to update???
          – user949300
          yesterday







        • 24




          It isn't updating or checking out though. It's taking whatever is exclusively in your branch, and adding your changes as if you just now made them on the other branch. I.e. your changes are now "based on" the other branch. Furthermore, there does not exist any magical source control system that knows your code and can know how to merge changes when multiple people modify the same files. You update every day to keep the conflicts small and manageable, and the changes fresh in everyone's minds so they know how to handle them.
          – Vectorjohn
          yesterday







        • 9




          @user949300 rebasing is distinct from merging, is much more nuanced and requires a better understanding of Git than a simple merge workflow. That's why I never recommend a workflow involving rebasing to a Git novice, because it leads to the assumption that rebasing is the only/default way to update a branch and leads to lots of unnecessary pitfalls and pain. In this case, merging will solve the problem in the same way and neither will solve the problem of merge conflicts in two long-running parallel feature branches.
          – Ant P
          yesterday







        • 4




          @AntP You're probably right about merging being the better option here, especially for a new user. Sometimes I merge, sometimes I rebase...depends on the circumstances.
          – Jacob Robbins
          yesterday






        • 5




          @user949300 git pull which is just a combination of git fetch and git merge (or you can add --rebase to do a rebase instead of a merge). Assuming you're only about a day behind, then on a LAN this will likely complete in less than second, it might take a couple seconds over the internet. Even over the internet and with minor merge conflicts, you can typically be up-to-date and merged cleanly in less than a minute. Spending five minutes spread throughout the week is a lot better than spending an hour at the end of week dealing with a gnarly merge conflict.
          – Derek Elkins
          yesterday







        6




        6




        I guess this is the correct answer, but, IMO, just another example of bad Git design and terminology. Just what are you "rebasing"? Shouldn't this be called "update" or "checkout" or "merge" or some such??? (An answer below argues for "fetch") What's the point of source code control if every day you are forced to update???
        – user949300
        yesterday





        I guess this is the correct answer, but, IMO, just another example of bad Git design and terminology. Just what are you "rebasing"? Shouldn't this be called "update" or "checkout" or "merge" or some such??? (An answer below argues for "fetch") What's the point of source code control if every day you are forced to update???
        – user949300
        yesterday





        24




        24




        It isn't updating or checking out though. It's taking whatever is exclusively in your branch, and adding your changes as if you just now made them on the other branch. I.e. your changes are now "based on" the other branch. Furthermore, there does not exist any magical source control system that knows your code and can know how to merge changes when multiple people modify the same files. You update every day to keep the conflicts small and manageable, and the changes fresh in everyone's minds so they know how to handle them.
        – Vectorjohn
        yesterday





        It isn't updating or checking out though. It's taking whatever is exclusively in your branch, and adding your changes as if you just now made them on the other branch. I.e. your changes are now "based on" the other branch. Furthermore, there does not exist any magical source control system that knows your code and can know how to merge changes when multiple people modify the same files. You update every day to keep the conflicts small and manageable, and the changes fresh in everyone's minds so they know how to handle them.
        – Vectorjohn
        yesterday





        9




        9




        @user949300 rebasing is distinct from merging, is much more nuanced and requires a better understanding of Git than a simple merge workflow. That's why I never recommend a workflow involving rebasing to a Git novice, because it leads to the assumption that rebasing is the only/default way to update a branch and leads to lots of unnecessary pitfalls and pain. In this case, merging will solve the problem in the same way and neither will solve the problem of merge conflicts in two long-running parallel feature branches.
        – Ant P
        yesterday





        @user949300 rebasing is distinct from merging, is much more nuanced and requires a better understanding of Git than a simple merge workflow. That's why I never recommend a workflow involving rebasing to a Git novice, because it leads to the assumption that rebasing is the only/default way to update a branch and leads to lots of unnecessary pitfalls and pain. In this case, merging will solve the problem in the same way and neither will solve the problem of merge conflicts in two long-running parallel feature branches.
        – Ant P
        yesterday





        4




        4




        @AntP You're probably right about merging being the better option here, especially for a new user. Sometimes I merge, sometimes I rebase...depends on the circumstances.
        – Jacob Robbins
        yesterday




        @AntP You're probably right about merging being the better option here, especially for a new user. Sometimes I merge, sometimes I rebase...depends on the circumstances.
        – Jacob Robbins
        yesterday




        5




        5




        @user949300 git pull which is just a combination of git fetch and git merge (or you can add --rebase to do a rebase instead of a merge). Assuming you're only about a day behind, then on a LAN this will likely complete in less than second, it might take a couple seconds over the internet. Even over the internet and with minor merge conflicts, you can typically be up-to-date and merged cleanly in less than a minute. Spending five minutes spread throughout the week is a lot better than spending an hour at the end of week dealing with a gnarly merge conflict.
        – Derek Elkins
        yesterday




        @user949300 git pull which is just a combination of git fetch and git merge (or you can add --rebase to do a rebase instead of a merge). Assuming you're only about a day behind, then on a LAN this will likely complete in less than second, it might take a couple seconds over the internet. Even over the internet and with minor merge conflicts, you can typically be up-to-date and merged cleanly in less than a minute. Spending five minutes spread throughout the week is a lot better than spending an hour at the end of week dealing with a gnarly merge conflict.
        – Derek Elkins
        yesterday












        up vote
        41
        down vote













        This might be a sign of bad software engineering on the company's part. Too many inter dependencies, different issues with overlapping features, attempting to tackle issues in the wrong order etc. can cause the situation you are describing. I suggest regularly merging develop into your branch during development






        share|improve this answer

















        • 2




          This is coding 101 stuff as you mentioned. Not necessarily an accurate reflection on the new employee.
          – Mister Positive
          yesterday






        • 1




          @Ivan Anatolievich OP says that they're branched off of develop, not master, FYI
          – Matthew FitzGerald-Chamberlain
          yesterday














        up vote
        41
        down vote













        This might be a sign of bad software engineering on the company's part. Too many inter dependencies, different issues with overlapping features, attempting to tackle issues in the wrong order etc. can cause the situation you are describing. I suggest regularly merging develop into your branch during development






        share|improve this answer

















        • 2




          This is coding 101 stuff as you mentioned. Not necessarily an accurate reflection on the new employee.
          – Mister Positive
          yesterday






        • 1




          @Ivan Anatolievich OP says that they're branched off of develop, not master, FYI
          – Matthew FitzGerald-Chamberlain
          yesterday












        up vote
        41
        down vote










        up vote
        41
        down vote









        This might be a sign of bad software engineering on the company's part. Too many inter dependencies, different issues with overlapping features, attempting to tackle issues in the wrong order etc. can cause the situation you are describing. I suggest regularly merging develop into your branch during development






        share|improve this answer













        This might be a sign of bad software engineering on the company's part. Too many inter dependencies, different issues with overlapping features, attempting to tackle issues in the wrong order etc. can cause the situation you are describing. I suggest regularly merging develop into your branch during development







        share|improve this answer













        share|improve this answer



        share|improve this answer











        answered yesterday









        Ivan Anatolievich

        48113




        48113







        • 2




          This is coding 101 stuff as you mentioned. Not necessarily an accurate reflection on the new employee.
          – Mister Positive
          yesterday






        • 1




          @Ivan Anatolievich OP says that they're branched off of develop, not master, FYI
          – Matthew FitzGerald-Chamberlain
          yesterday












        • 2




          This is coding 101 stuff as you mentioned. Not necessarily an accurate reflection on the new employee.
          – Mister Positive
          yesterday






        • 1




          @Ivan Anatolievich OP says that they're branched off of develop, not master, FYI
          – Matthew FitzGerald-Chamberlain
          yesterday







        2




        2




        This is coding 101 stuff as you mentioned. Not necessarily an accurate reflection on the new employee.
        – Mister Positive
        yesterday




        This is coding 101 stuff as you mentioned. Not necessarily an accurate reflection on the new employee.
        – Mister Positive
        yesterday




        1




        1




        @Ivan Anatolievich OP says that they're branched off of develop, not master, FYI
        – Matthew FitzGerald-Chamberlain
        yesterday




        @Ivan Anatolievich OP says that they're branched off of develop, not master, FYI
        – Matthew FitzGerald-Chamberlain
        yesterday










        up vote
        28
        down vote













        The accepted answers I think are more of a technical "how to use Git better" nature, I think this is more of a team problem than an engineering or tooling problem.



        If you're encountering a lot of merge conflicts it means that you and someone else on the team are stepping on each others toes.

        You or they should aim to develop personal space while coding and avoid working in areas that are busy already.



        In my team, we tend towards a high degree of task-ownership.

        I'll usually take full and complete ownership of two or three files at a time and work on them in a branch for a day or two at most.

        Typically if anyone else touches those files it's only if absolutely necessary for their own tasks, we generally don't work together on the same block of tasks at all!



        If you're finding that you have to merge a lot at all then either all your teams code is in one place (which is something to avoid in itself) or all your tasks are.



        All that said, as a new dev you're probably not in a position to enforce, request or even really suggest any sort of restructuring.

        What I'd expect is that your tasks have been assigned as "learn-the-ropes" stuff that should be reasonably approachable at your skill level in order to ease you into the team. They've probably been culled from the tasks of a co-worker who is still working in the same area, hence your merge conflicts.

        The solution to this then is to plug away at it, solve the problems, deal with the merge conflicts as best you can and don't worry too much, as long as you're doing your best it's down to your manager to worry about your progress.

        You'll get faster and more confident as you go, and your co-workers will give you more autonomy and get in your way less as a consequence.






        share|improve this answer

















        • 1




          I think you hit the nail on the head with the co-worker conflict. Merge conflicts are a regular thing, but they are generally limited to a handful of files.
          – Matthieu M.
          yesterday










        • Yesterday I dealt with just three minor merge conflicts. just a function I'd put in place with an input variable, and then the other guy had removed the need for that variable. That's the kind of problems we encounter as a well-delineated team. If you have to replace a whole line or weigh up which block of code is "correct" then something has gone pretty wrong. God forbid you have hundreds of tiny problems throughout the file. That's usually more of an auto-formatting problem. Setting up Visual Studio to handle it consistently solves that completely.
          – Ruadhan2300
          yesterday






        • 2




          This sounds like a corollary to Conway's Law, and the Single responsibility principle -- i.e. that if people are working on different problems then ideally they'll be editing separate parts of the source code.
          – ChrisW
          yesterday










        • @ChrisW Ideally. OP doesn't say whether the project is a tangled mess. (And being new, may not know the difference.)
          – TKK
          yesterday






        • 2




          While I agree that a poor process or poor design can lead to a large amount of conflicts, I'm pretty confident that the issue is simply that the OP isn't merging in the mainline regularly. I don't agree that "taking full and complete ownership" of files is appropriate as a matter of course. I don't want my team having a constant overhead of keeping track of who "owns" what now, asking "permission" to make changes, or guessing what files they should "claim". Only rarely, when significantly rewriting a component, have I asked team members to inform me if they were going to change certain files.
          – Derek Elkins
          yesterday














        up vote
        28
        down vote













        The accepted answers I think are more of a technical "how to use Git better" nature, I think this is more of a team problem than an engineering or tooling problem.



        If you're encountering a lot of merge conflicts it means that you and someone else on the team are stepping on each others toes.

        You or they should aim to develop personal space while coding and avoid working in areas that are busy already.



        In my team, we tend towards a high degree of task-ownership.

        I'll usually take full and complete ownership of two or three files at a time and work on them in a branch for a day or two at most.

        Typically if anyone else touches those files it's only if absolutely necessary for their own tasks, we generally don't work together on the same block of tasks at all!



        If you're finding that you have to merge a lot at all then either all your teams code is in one place (which is something to avoid in itself) or all your tasks are.



        All that said, as a new dev you're probably not in a position to enforce, request or even really suggest any sort of restructuring.

        What I'd expect is that your tasks have been assigned as "learn-the-ropes" stuff that should be reasonably approachable at your skill level in order to ease you into the team. They've probably been culled from the tasks of a co-worker who is still working in the same area, hence your merge conflicts.

        The solution to this then is to plug away at it, solve the problems, deal with the merge conflicts as best you can and don't worry too much, as long as you're doing your best it's down to your manager to worry about your progress.

        You'll get faster and more confident as you go, and your co-workers will give you more autonomy and get in your way less as a consequence.






        share|improve this answer

















        • 1




          I think you hit the nail on the head with the co-worker conflict. Merge conflicts are a regular thing, but they are generally limited to a handful of files.
          – Matthieu M.
          yesterday










        • Yesterday I dealt with just three minor merge conflicts. just a function I'd put in place with an input variable, and then the other guy had removed the need for that variable. That's the kind of problems we encounter as a well-delineated team. If you have to replace a whole line or weigh up which block of code is "correct" then something has gone pretty wrong. God forbid you have hundreds of tiny problems throughout the file. That's usually more of an auto-formatting problem. Setting up Visual Studio to handle it consistently solves that completely.
          – Ruadhan2300
          yesterday






        • 2




          This sounds like a corollary to Conway's Law, and the Single responsibility principle -- i.e. that if people are working on different problems then ideally they'll be editing separate parts of the source code.
          – ChrisW
          yesterday










        • @ChrisW Ideally. OP doesn't say whether the project is a tangled mess. (And being new, may not know the difference.)
          – TKK
          yesterday






        • 2




          While I agree that a poor process or poor design can lead to a large amount of conflicts, I'm pretty confident that the issue is simply that the OP isn't merging in the mainline regularly. I don't agree that "taking full and complete ownership" of files is appropriate as a matter of course. I don't want my team having a constant overhead of keeping track of who "owns" what now, asking "permission" to make changes, or guessing what files they should "claim". Only rarely, when significantly rewriting a component, have I asked team members to inform me if they were going to change certain files.
          – Derek Elkins
          yesterday












        up vote
        28
        down vote










        up vote
        28
        down vote









        The accepted answers I think are more of a technical "how to use Git better" nature, I think this is more of a team problem than an engineering or tooling problem.



        If you're encountering a lot of merge conflicts it means that you and someone else on the team are stepping on each others toes.

        You or they should aim to develop personal space while coding and avoid working in areas that are busy already.



        In my team, we tend towards a high degree of task-ownership.

        I'll usually take full and complete ownership of two or three files at a time and work on them in a branch for a day or two at most.

        Typically if anyone else touches those files it's only if absolutely necessary for their own tasks, we generally don't work together on the same block of tasks at all!



        If you're finding that you have to merge a lot at all then either all your teams code is in one place (which is something to avoid in itself) or all your tasks are.



        All that said, as a new dev you're probably not in a position to enforce, request or even really suggest any sort of restructuring.

        What I'd expect is that your tasks have been assigned as "learn-the-ropes" stuff that should be reasonably approachable at your skill level in order to ease you into the team. They've probably been culled from the tasks of a co-worker who is still working in the same area, hence your merge conflicts.

        The solution to this then is to plug away at it, solve the problems, deal with the merge conflicts as best you can and don't worry too much, as long as you're doing your best it's down to your manager to worry about your progress.

        You'll get faster and more confident as you go, and your co-workers will give you more autonomy and get in your way less as a consequence.






        share|improve this answer













        The accepted answers I think are more of a technical "how to use Git better" nature, I think this is more of a team problem than an engineering or tooling problem.



        If you're encountering a lot of merge conflicts it means that you and someone else on the team are stepping on each others toes.

        You or they should aim to develop personal space while coding and avoid working in areas that are busy already.



        In my team, we tend towards a high degree of task-ownership.

        I'll usually take full and complete ownership of two or three files at a time and work on them in a branch for a day or two at most.

        Typically if anyone else touches those files it's only if absolutely necessary for their own tasks, we generally don't work together on the same block of tasks at all!



        If you're finding that you have to merge a lot at all then either all your teams code is in one place (which is something to avoid in itself) or all your tasks are.



        All that said, as a new dev you're probably not in a position to enforce, request or even really suggest any sort of restructuring.

        What I'd expect is that your tasks have been assigned as "learn-the-ropes" stuff that should be reasonably approachable at your skill level in order to ease you into the team. They've probably been culled from the tasks of a co-worker who is still working in the same area, hence your merge conflicts.

        The solution to this then is to plug away at it, solve the problems, deal with the merge conflicts as best you can and don't worry too much, as long as you're doing your best it's down to your manager to worry about your progress.

        You'll get faster and more confident as you go, and your co-workers will give you more autonomy and get in your way less as a consequence.







        share|improve this answer













        share|improve this answer



        share|improve this answer











        answered yesterday







        Ruadhan2300














        • 1




          I think you hit the nail on the head with the co-worker conflict. Merge conflicts are a regular thing, but they are generally limited to a handful of files.
          – Matthieu M.
          yesterday










        • Yesterday I dealt with just three minor merge conflicts. just a function I'd put in place with an input variable, and then the other guy had removed the need for that variable. That's the kind of problems we encounter as a well-delineated team. If you have to replace a whole line or weigh up which block of code is "correct" then something has gone pretty wrong. God forbid you have hundreds of tiny problems throughout the file. That's usually more of an auto-formatting problem. Setting up Visual Studio to handle it consistently solves that completely.
          – Ruadhan2300
          yesterday






        • 2




          This sounds like a corollary to Conway's Law, and the Single responsibility principle -- i.e. that if people are working on different problems then ideally they'll be editing separate parts of the source code.
          – ChrisW
          yesterday










        • @ChrisW Ideally. OP doesn't say whether the project is a tangled mess. (And being new, may not know the difference.)
          – TKK
          yesterday






        • 2




          While I agree that a poor process or poor design can lead to a large amount of conflicts, I'm pretty confident that the issue is simply that the OP isn't merging in the mainline regularly. I don't agree that "taking full and complete ownership" of files is appropriate as a matter of course. I don't want my team having a constant overhead of keeping track of who "owns" what now, asking "permission" to make changes, or guessing what files they should "claim". Only rarely, when significantly rewriting a component, have I asked team members to inform me if they were going to change certain files.
          – Derek Elkins
          yesterday












        • 1




          I think you hit the nail on the head with the co-worker conflict. Merge conflicts are a regular thing, but they are generally limited to a handful of files.
          – Matthieu M.
          yesterday










        • Yesterday I dealt with just three minor merge conflicts. just a function I'd put in place with an input variable, and then the other guy had removed the need for that variable. That's the kind of problems we encounter as a well-delineated team. If you have to replace a whole line or weigh up which block of code is "correct" then something has gone pretty wrong. God forbid you have hundreds of tiny problems throughout the file. That's usually more of an auto-formatting problem. Setting up Visual Studio to handle it consistently solves that completely.
          – Ruadhan2300
          yesterday






        • 2




          This sounds like a corollary to Conway's Law, and the Single responsibility principle -- i.e. that if people are working on different problems then ideally they'll be editing separate parts of the source code.
          – ChrisW
          yesterday










        • @ChrisW Ideally. OP doesn't say whether the project is a tangled mess. (And being new, may not know the difference.)
          – TKK
          yesterday






        • 2




          While I agree that a poor process or poor design can lead to a large amount of conflicts, I'm pretty confident that the issue is simply that the OP isn't merging in the mainline regularly. I don't agree that "taking full and complete ownership" of files is appropriate as a matter of course. I don't want my team having a constant overhead of keeping track of who "owns" what now, asking "permission" to make changes, or guessing what files they should "claim". Only rarely, when significantly rewriting a component, have I asked team members to inform me if they were going to change certain files.
          – Derek Elkins
          yesterday







        1




        1




        I think you hit the nail on the head with the co-worker conflict. Merge conflicts are a regular thing, but they are generally limited to a handful of files.
        – Matthieu M.
        yesterday




        I think you hit the nail on the head with the co-worker conflict. Merge conflicts are a regular thing, but they are generally limited to a handful of files.
        – Matthieu M.
        yesterday












        Yesterday I dealt with just three minor merge conflicts. just a function I'd put in place with an input variable, and then the other guy had removed the need for that variable. That's the kind of problems we encounter as a well-delineated team. If you have to replace a whole line or weigh up which block of code is "correct" then something has gone pretty wrong. God forbid you have hundreds of tiny problems throughout the file. That's usually more of an auto-formatting problem. Setting up Visual Studio to handle it consistently solves that completely.
        – Ruadhan2300
        yesterday




        Yesterday I dealt with just three minor merge conflicts. just a function I'd put in place with an input variable, and then the other guy had removed the need for that variable. That's the kind of problems we encounter as a well-delineated team. If you have to replace a whole line or weigh up which block of code is "correct" then something has gone pretty wrong. God forbid you have hundreds of tiny problems throughout the file. That's usually more of an auto-formatting problem. Setting up Visual Studio to handle it consistently solves that completely.
        – Ruadhan2300
        yesterday




        2




        2




        This sounds like a corollary to Conway's Law, and the Single responsibility principle -- i.e. that if people are working on different problems then ideally they'll be editing separate parts of the source code.
        – ChrisW
        yesterday




        This sounds like a corollary to Conway's Law, and the Single responsibility principle -- i.e. that if people are working on different problems then ideally they'll be editing separate parts of the source code.
        – ChrisW
        yesterday












        @ChrisW Ideally. OP doesn't say whether the project is a tangled mess. (And being new, may not know the difference.)
        – TKK
        yesterday




        @ChrisW Ideally. OP doesn't say whether the project is a tangled mess. (And being new, may not know the difference.)
        – TKK
        yesterday




        2




        2




        While I agree that a poor process or poor design can lead to a large amount of conflicts, I'm pretty confident that the issue is simply that the OP isn't merging in the mainline regularly. I don't agree that "taking full and complete ownership" of files is appropriate as a matter of course. I don't want my team having a constant overhead of keeping track of who "owns" what now, asking "permission" to make changes, or guessing what files they should "claim". Only rarely, when significantly rewriting a component, have I asked team members to inform me if they were going to change certain files.
        – Derek Elkins
        yesterday




        While I agree that a poor process or poor design can lead to a large amount of conflicts, I'm pretty confident that the issue is simply that the OP isn't merging in the mainline regularly. I don't agree that "taking full and complete ownership" of files is appropriate as a matter of course. I don't want my team having a constant overhead of keeping track of who "owns" what now, asking "permission" to make changes, or guessing what files they should "claim". Only rarely, when significantly rewriting a component, have I asked team members to inform me if they were going to change certain files.
        – Derek Elkins
        yesterday










        up vote
        4
        down vote













        The most important thing about merging is that the longer you wait, the more painful it gets. And the problem grows more than linear. Three times as many conflicts are nine times as much work. There are some strategies:



        Merge with the development branch whenever it changes, so you are always close to it, and never have a huge number of conflicts.



        If you take a long time, then it may be because you spend most of the time figuring out what the changes are, and then a small amount of time implementing the changes. If that is the case, merge with the development branch before you start actual code changes.



        Talk to your colleagues about strategies to avoid conflicts. You get conflicts if two people edit the same code. Not just the same file, but the same code. So I need a new function functionA and you need a new function functionB, and we both add it at the end of the same file, we have a conflict. If we add it in different places, no conflict. If we both add it at a place in the file where it logically belongs, chances are we have no conflict.



        If you have conflicts, get a good diff tool, so you can compare the develop branch before your merge, your code before the merge, your original code, and the merged code, and merge by hand.



        Worst case: You don't throw your work away, but use a good diff tool to find out exactly what changes you made, branch again from develop, and apply all the changes you made manually instead of retyping them.






        share|improve this answer

























          up vote
          4
          down vote













          The most important thing about merging is that the longer you wait, the more painful it gets. And the problem grows more than linear. Three times as many conflicts are nine times as much work. There are some strategies:



          Merge with the development branch whenever it changes, so you are always close to it, and never have a huge number of conflicts.



          If you take a long time, then it may be because you spend most of the time figuring out what the changes are, and then a small amount of time implementing the changes. If that is the case, merge with the development branch before you start actual code changes.



          Talk to your colleagues about strategies to avoid conflicts. You get conflicts if two people edit the same code. Not just the same file, but the same code. So I need a new function functionA and you need a new function functionB, and we both add it at the end of the same file, we have a conflict. If we add it in different places, no conflict. If we both add it at a place in the file where it logically belongs, chances are we have no conflict.



          If you have conflicts, get a good diff tool, so you can compare the develop branch before your merge, your code before the merge, your original code, and the merged code, and merge by hand.



          Worst case: You don't throw your work away, but use a good diff tool to find out exactly what changes you made, branch again from develop, and apply all the changes you made manually instead of retyping them.






          share|improve this answer























            up vote
            4
            down vote










            up vote
            4
            down vote









            The most important thing about merging is that the longer you wait, the more painful it gets. And the problem grows more than linear. Three times as many conflicts are nine times as much work. There are some strategies:



            Merge with the development branch whenever it changes, so you are always close to it, and never have a huge number of conflicts.



            If you take a long time, then it may be because you spend most of the time figuring out what the changes are, and then a small amount of time implementing the changes. If that is the case, merge with the development branch before you start actual code changes.



            Talk to your colleagues about strategies to avoid conflicts. You get conflicts if two people edit the same code. Not just the same file, but the same code. So I need a new function functionA and you need a new function functionB, and we both add it at the end of the same file, we have a conflict. If we add it in different places, no conflict. If we both add it at a place in the file where it logically belongs, chances are we have no conflict.



            If you have conflicts, get a good diff tool, so you can compare the develop branch before your merge, your code before the merge, your original code, and the merged code, and merge by hand.



            Worst case: You don't throw your work away, but use a good diff tool to find out exactly what changes you made, branch again from develop, and apply all the changes you made manually instead of retyping them.






            share|improve this answer













            The most important thing about merging is that the longer you wait, the more painful it gets. And the problem grows more than linear. Three times as many conflicts are nine times as much work. There are some strategies:



            Merge with the development branch whenever it changes, so you are always close to it, and never have a huge number of conflicts.



            If you take a long time, then it may be because you spend most of the time figuring out what the changes are, and then a small amount of time implementing the changes. If that is the case, merge with the development branch before you start actual code changes.



            Talk to your colleagues about strategies to avoid conflicts. You get conflicts if two people edit the same code. Not just the same file, but the same code. So I need a new function functionA and you need a new function functionB, and we both add it at the end of the same file, we have a conflict. If we add it in different places, no conflict. If we both add it at a place in the file where it logically belongs, chances are we have no conflict.



            If you have conflicts, get a good diff tool, so you can compare the develop branch before your merge, your code before the merge, your original code, and the merged code, and merge by hand.



            Worst case: You don't throw your work away, but use a good diff tool to find out exactly what changes you made, branch again from develop, and apply all the changes you made manually instead of retyping them.







            share|improve this answer













            share|improve this answer



            share|improve this answer











            answered yesterday









            gnasher729

            17.9k22351




            17.9k22351




















                up vote
                3
                down vote













                You should run regularly (daily) the command 'git fetch' (not git pull) from your development branch. This will get other peoples committed changes and bring them into your feature branch without attempting to integrate the changes into your branch.



                This is something you should talk to the lead developer about (not necessarily your manager), because your company may have their own standards or recommended ways of handling this issue; it's very common. Don't wait until next week - find out the process now, and ask if you can commit some trivial work (such as code formatting or adding comments) so you can test the process.






                share|improve this answer

















                • 16




                  I'm not sure this is correct. Git fetch will get remotes/origin/master up to date but you then need to merge remotes/origin/master into your feature branch (Or remotes/origin/develop if that's the flow they are using)
                  – Richard Tingle
                  yesterday










                • Assuming he's using git, it's also a good idea to learn how to squash your commit to meaningful parts. That way when you're ready to make a pull request, your commit is lean and straightforward and easy to understand.
                  – Dan
                  yesterday










                • @RichardTingle Correct, He's thinking of a rebase option. You simply fetch & rebase your branch with the dev branch. That will sync up everything.
                  – Dan
                  yesterday






                • 5




                  @Dan I think that may be a matter of opinion. Personally I hate massive commits. Try git bisecting that!
                  – Richard Tingle
                  yesterday










                • @PeteCon "and bring them into your feature branch without attempting to integrate the changes into your branch". That seems like a contradictory statement. I think you mean bring them into your local repository without integrating them into your feature branch, but I'm not sure how that helps...
                  – Jason Goemaat
                  1 hour ago














                up vote
                3
                down vote













                You should run regularly (daily) the command 'git fetch' (not git pull) from your development branch. This will get other peoples committed changes and bring them into your feature branch without attempting to integrate the changes into your branch.



                This is something you should talk to the lead developer about (not necessarily your manager), because your company may have their own standards or recommended ways of handling this issue; it's very common. Don't wait until next week - find out the process now, and ask if you can commit some trivial work (such as code formatting or adding comments) so you can test the process.






                share|improve this answer

















                • 16




                  I'm not sure this is correct. Git fetch will get remotes/origin/master up to date but you then need to merge remotes/origin/master into your feature branch (Or remotes/origin/develop if that's the flow they are using)
                  – Richard Tingle
                  yesterday










                • Assuming he's using git, it's also a good idea to learn how to squash your commit to meaningful parts. That way when you're ready to make a pull request, your commit is lean and straightforward and easy to understand.
                  – Dan
                  yesterday










                • @RichardTingle Correct, He's thinking of a rebase option. You simply fetch & rebase your branch with the dev branch. That will sync up everything.
                  – Dan
                  yesterday






                • 5




                  @Dan I think that may be a matter of opinion. Personally I hate massive commits. Try git bisecting that!
                  – Richard Tingle
                  yesterday










                • @PeteCon "and bring them into your feature branch without attempting to integrate the changes into your branch". That seems like a contradictory statement. I think you mean bring them into your local repository without integrating them into your feature branch, but I'm not sure how that helps...
                  – Jason Goemaat
                  1 hour ago












                up vote
                3
                down vote










                up vote
                3
                down vote









                You should run regularly (daily) the command 'git fetch' (not git pull) from your development branch. This will get other peoples committed changes and bring them into your feature branch without attempting to integrate the changes into your branch.



                This is something you should talk to the lead developer about (not necessarily your manager), because your company may have their own standards or recommended ways of handling this issue; it's very common. Don't wait until next week - find out the process now, and ask if you can commit some trivial work (such as code formatting or adding comments) so you can test the process.






                share|improve this answer













                You should run regularly (daily) the command 'git fetch' (not git pull) from your development branch. This will get other peoples committed changes and bring them into your feature branch without attempting to integrate the changes into your branch.



                This is something you should talk to the lead developer about (not necessarily your manager), because your company may have their own standards or recommended ways of handling this issue; it's very common. Don't wait until next week - find out the process now, and ask if you can commit some trivial work (such as code formatting or adding comments) so you can test the process.







                share|improve this answer













                share|improve this answer



                share|improve this answer











                answered yesterday







                PeteCon














                • 16




                  I'm not sure this is correct. Git fetch will get remotes/origin/master up to date but you then need to merge remotes/origin/master into your feature branch (Or remotes/origin/develop if that's the flow they are using)
                  – Richard Tingle
                  yesterday










                • Assuming he's using git, it's also a good idea to learn how to squash your commit to meaningful parts. That way when you're ready to make a pull request, your commit is lean and straightforward and easy to understand.
                  – Dan
                  yesterday










                • @RichardTingle Correct, He's thinking of a rebase option. You simply fetch & rebase your branch with the dev branch. That will sync up everything.
                  – Dan
                  yesterday






                • 5




                  @Dan I think that may be a matter of opinion. Personally I hate massive commits. Try git bisecting that!
                  – Richard Tingle
                  yesterday










                • @PeteCon "and bring them into your feature branch without attempting to integrate the changes into your branch". That seems like a contradictory statement. I think you mean bring them into your local repository without integrating them into your feature branch, but I'm not sure how that helps...
                  – Jason Goemaat
                  1 hour ago












                • 16




                  I'm not sure this is correct. Git fetch will get remotes/origin/master up to date but you then need to merge remotes/origin/master into your feature branch (Or remotes/origin/develop if that's the flow they are using)
                  – Richard Tingle
                  yesterday










                • Assuming he's using git, it's also a good idea to learn how to squash your commit to meaningful parts. That way when you're ready to make a pull request, your commit is lean and straightforward and easy to understand.
                  – Dan
                  yesterday










                • @RichardTingle Correct, He's thinking of a rebase option. You simply fetch & rebase your branch with the dev branch. That will sync up everything.
                  – Dan
                  yesterday






                • 5




                  @Dan I think that may be a matter of opinion. Personally I hate massive commits. Try git bisecting that!
                  – Richard Tingle
                  yesterday










                • @PeteCon "and bring them into your feature branch without attempting to integrate the changes into your branch". That seems like a contradictory statement. I think you mean bring them into your local repository without integrating them into your feature branch, but I'm not sure how that helps...
                  – Jason Goemaat
                  1 hour ago







                16




                16




                I'm not sure this is correct. Git fetch will get remotes/origin/master up to date but you then need to merge remotes/origin/master into your feature branch (Or remotes/origin/develop if that's the flow they are using)
                – Richard Tingle
                yesterday




                I'm not sure this is correct. Git fetch will get remotes/origin/master up to date but you then need to merge remotes/origin/master into your feature branch (Or remotes/origin/develop if that's the flow they are using)
                – Richard Tingle
                yesterday












                Assuming he's using git, it's also a good idea to learn how to squash your commit to meaningful parts. That way when you're ready to make a pull request, your commit is lean and straightforward and easy to understand.
                – Dan
                yesterday




                Assuming he's using git, it's also a good idea to learn how to squash your commit to meaningful parts. That way when you're ready to make a pull request, your commit is lean and straightforward and easy to understand.
                – Dan
                yesterday












                @RichardTingle Correct, He's thinking of a rebase option. You simply fetch & rebase your branch with the dev branch. That will sync up everything.
                – Dan
                yesterday




                @RichardTingle Correct, He's thinking of a rebase option. You simply fetch & rebase your branch with the dev branch. That will sync up everything.
                – Dan
                yesterday




                5




                5




                @Dan I think that may be a matter of opinion. Personally I hate massive commits. Try git bisecting that!
                – Richard Tingle
                yesterday




                @Dan I think that may be a matter of opinion. Personally I hate massive commits. Try git bisecting that!
                – Richard Tingle
                yesterday












                @PeteCon "and bring them into your feature branch without attempting to integrate the changes into your branch". That seems like a contradictory statement. I think you mean bring them into your local repository without integrating them into your feature branch, but I'm not sure how that helps...
                – Jason Goemaat
                1 hour ago




                @PeteCon "and bring them into your feature branch without attempting to integrate the changes into your branch". That seems like a contradictory statement. I think you mean bring them into your local repository without integrating them into your feature branch, but I'm not sure how that helps...
                – Jason Goemaat
                1 hour ago










                up vote
                2
                down vote













                First, don't think about discarding your changes. You will loose opportunities to learn merge process.



                Second, find person who worked on files causing conflict. You can see history. Talk to person and resolve conflicts in that files. Do same for other conflicts.



                If it's too many conflicts, your task may be a minor but repetitive. Try to find pattern. This would help in resolving conflicts by git UI client tools. I use TortoiseGit. It helps in merge.



                And for avoiding in future,



                -it's a very good practice to merge develop branch regularly to your feature branch.



                -If you have CI enabled, see if CI tool provide branch build. This should build on every check in you make in your feature branch but after merge develop branch.





                share

























                  up vote
                  2
                  down vote













                  First, don't think about discarding your changes. You will loose opportunities to learn merge process.



                  Second, find person who worked on files causing conflict. You can see history. Talk to person and resolve conflicts in that files. Do same for other conflicts.



                  If it's too many conflicts, your task may be a minor but repetitive. Try to find pattern. This would help in resolving conflicts by git UI client tools. I use TortoiseGit. It helps in merge.



                  And for avoiding in future,



                  -it's a very good practice to merge develop branch regularly to your feature branch.



                  -If you have CI enabled, see if CI tool provide branch build. This should build on every check in you make in your feature branch but after merge develop branch.





                  share























                    up vote
                    2
                    down vote










                    up vote
                    2
                    down vote









                    First, don't think about discarding your changes. You will loose opportunities to learn merge process.



                    Second, find person who worked on files causing conflict. You can see history. Talk to person and resolve conflicts in that files. Do same for other conflicts.



                    If it's too many conflicts, your task may be a minor but repetitive. Try to find pattern. This would help in resolving conflicts by git UI client tools. I use TortoiseGit. It helps in merge.



                    And for avoiding in future,



                    -it's a very good practice to merge develop branch regularly to your feature branch.



                    -If you have CI enabled, see if CI tool provide branch build. This should build on every check in you make in your feature branch but after merge develop branch.





                    share













                    First, don't think about discarding your changes. You will loose opportunities to learn merge process.



                    Second, find person who worked on files causing conflict. You can see history. Talk to person and resolve conflicts in that files. Do same for other conflicts.



                    If it's too many conflicts, your task may be a minor but repetitive. Try to find pattern. This would help in resolving conflicts by git UI client tools. I use TortoiseGit. It helps in merge.



                    And for avoiding in future,



                    -it's a very good practice to merge develop branch regularly to your feature branch.



                    -If you have CI enabled, see if CI tool provide branch build. This should build on every check in you make in your feature branch but after merge develop branch.






                    share












                    share


                    share











                    answered yesterday









                    PKV

                    1291




                    1291




















                        up vote
                        0
                        down vote













                        You get merge conflicts if the changes you did in your branch are near the changes your colleagues did in the develop branch in the meantime, that is, if you and your colleagues changed the same lines of code or adjacent lines in the same file.



                        So to reduce the likelihood of merge conflicts, you can try to merge earlier so that your colleagues changed fewer lines in the meantime, or you can try to change fewer lines yourself.



                        To change fewer lines yourself, make sure to only make changes related to your task.



                        If you need to experiment with different ways to achieve your goal, maybe some of your experiments changed lines that don't really need to be changed? Undo these changes before merging.



                        There are also some Git commands that can help you change as few lines as possible:




                        • git diff and git diff --staged to see which lines you changed.


                        • git add -p to only add some of your changes in a file.


                        • git commit --amend and git rebase -i to tweak commits you already made in your local feature branch before pushing them to other Git repositories.

                        (Changing as few lines as possible can also make it easier to review your work or to use tools that work on the differences between commits such as git cherry-pick, git rebase, git bisect, and git blame.)



                        But even if you reduce the likelihood of merge conflicts, you will still run into merge conflicts sometimes. So don't be afraid of them, but learn how to resolve the conflicts.






                        share|improve this answer



























                          up vote
                          0
                          down vote













                          You get merge conflicts if the changes you did in your branch are near the changes your colleagues did in the develop branch in the meantime, that is, if you and your colleagues changed the same lines of code or adjacent lines in the same file.



                          So to reduce the likelihood of merge conflicts, you can try to merge earlier so that your colleagues changed fewer lines in the meantime, or you can try to change fewer lines yourself.



                          To change fewer lines yourself, make sure to only make changes related to your task.



                          If you need to experiment with different ways to achieve your goal, maybe some of your experiments changed lines that don't really need to be changed? Undo these changes before merging.



                          There are also some Git commands that can help you change as few lines as possible:




                          • git diff and git diff --staged to see which lines you changed.


                          • git add -p to only add some of your changes in a file.


                          • git commit --amend and git rebase -i to tweak commits you already made in your local feature branch before pushing them to other Git repositories.

                          (Changing as few lines as possible can also make it easier to review your work or to use tools that work on the differences between commits such as git cherry-pick, git rebase, git bisect, and git blame.)



                          But even if you reduce the likelihood of merge conflicts, you will still run into merge conflicts sometimes. So don't be afraid of them, but learn how to resolve the conflicts.






                          share|improve this answer

























                            up vote
                            0
                            down vote










                            up vote
                            0
                            down vote









                            You get merge conflicts if the changes you did in your branch are near the changes your colleagues did in the develop branch in the meantime, that is, if you and your colleagues changed the same lines of code or adjacent lines in the same file.



                            So to reduce the likelihood of merge conflicts, you can try to merge earlier so that your colleagues changed fewer lines in the meantime, or you can try to change fewer lines yourself.



                            To change fewer lines yourself, make sure to only make changes related to your task.



                            If you need to experiment with different ways to achieve your goal, maybe some of your experiments changed lines that don't really need to be changed? Undo these changes before merging.



                            There are also some Git commands that can help you change as few lines as possible:




                            • git diff and git diff --staged to see which lines you changed.


                            • git add -p to only add some of your changes in a file.


                            • git commit --amend and git rebase -i to tweak commits you already made in your local feature branch before pushing them to other Git repositories.

                            (Changing as few lines as possible can also make it easier to review your work or to use tools that work on the differences between commits such as git cherry-pick, git rebase, git bisect, and git blame.)



                            But even if you reduce the likelihood of merge conflicts, you will still run into merge conflicts sometimes. So don't be afraid of them, but learn how to resolve the conflicts.






                            share|improve this answer















                            You get merge conflicts if the changes you did in your branch are near the changes your colleagues did in the develop branch in the meantime, that is, if you and your colleagues changed the same lines of code or adjacent lines in the same file.



                            So to reduce the likelihood of merge conflicts, you can try to merge earlier so that your colleagues changed fewer lines in the meantime, or you can try to change fewer lines yourself.



                            To change fewer lines yourself, make sure to only make changes related to your task.



                            If you need to experiment with different ways to achieve your goal, maybe some of your experiments changed lines that don't really need to be changed? Undo these changes before merging.



                            There are also some Git commands that can help you change as few lines as possible:




                            • git diff and git diff --staged to see which lines you changed.


                            • git add -p to only add some of your changes in a file.


                            • git commit --amend and git rebase -i to tweak commits you already made in your local feature branch before pushing them to other Git repositories.

                            (Changing as few lines as possible can also make it easier to review your work or to use tools that work on the differences between commits such as git cherry-pick, git rebase, git bisect, and git blame.)



                            But even if you reduce the likelihood of merge conflicts, you will still run into merge conflicts sometimes. So don't be afraid of them, but learn how to resolve the conflicts.







                            share|improve this answer















                            share|improve this answer



                            share|improve this answer








                            edited 1 hour ago









                            Peter Mortensen

                            1,11621114




                            1,11621114











                            answered 15 hours ago









                            Toxaris

                            1465




                            1465















                                protected by gnat 13 hours ago



                                Thank you for your interest in this question.
                                Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).



                                Would you like to answer one of these unanswered questions instead?



                                Popular posts from this blog

                                ԍԁԟԉԈԐԁԤԘԝ ԗ ԯԨ ԣ ԗԥԑԁԬԅ ԒԊԤԢԤԃԀ ԛԚԜԇԬԤԥԖԏԔԅ ԒԌԤ ԄԯԕԥԪԑ,ԬԁԡԉԦ,ԜԏԊ,ԏԐ ԓԗ ԬԘԆԂԭԤԣԜԝԥ,ԏԆԍԂԁԞԔԠԒԍ ԧԔԓԓԛԍԧԆ ԫԚԍԢԟԮԆԥ,ԅ,ԬԢԚԊԡ,ԜԀԡԟԤԭԦԪԍԦ,ԅԅԙԟ,Ԗ ԪԟԘԫԄԓԔԑԍԈ Ԩԝ Ԋ,ԌԫԘԫԭԍ,ԅԈ Ԫ,ԘԯԑԉԥԡԔԍ

                                How to change the default border color of fbox? [duplicate]

                                Henj