[{"data":1,"prerenderedAt":530},["ShallowReactive",2],{"tag-sourcecontrol":3},{"tag":4,"articles":24},{"id":5,"title":6,"body":7,"description":14,"extension":15,"img":16,"meta":17,"name":18,"navigation":19,"path":20,"seo":21,"stem":22,"__hash__":23},"tags\u002Ftags\u002Fsourcecontrol.md","Sourcecontrol",{"type":8,"value":9,"toc":10},"minimark",[],{"title":11,"searchDepth":12,"depth":12,"links":13},"",2,[],"Source control refers to tracking and managing changes to code. This ensures that developers are always working on the right version of source code.","md","https:\u002F\u002Fimages.unsplash.com\u002Fphoto-1598313183973-4effcded8d5e?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=675&q=80",{},"sourcecontrol",true,"\u002Ftags\u002Fsourcecontrol",{"description":14},"tags\u002Fsourcecontrol","txFWQUvKfmOZSUyYKCc7uSDzQBPUHuUci03EOyNYfK8",[25,250,387],{"id":26,"title":27,"author":28,"body":29,"createdAt":240,"description":241,"extension":15,"img":242,"meta":243,"navigation":19,"path":244,"seo":245,"stem":246,"tags":247,"updatedAt":240,"__hash__":249},"articles\u002Farticles\u002Fgit_resolve_conflicts_vscode.md","Resolve Git Conflicts with Visual Studio Code","[object Object]",{"type":8,"value":30,"toc":232},[31,36,45,50,60,63,73,77,80,85,91,95,98,137,141,144,155,158,162,165,169,172,176,182,186,189,218,222,228],[32,33,35],"h2",{"id":34},"how-to-resolve-git-conflicts-with-visual-studio-code","How to Resolve Git Conflicts with Visual Studio Code",[37,38,39,40,44],"p",{},"Git is a powerful version control system that helps developers collaborate on projects seamlessly. However, in the world of collaborative coding, conflicts can arise when different team members make changes to the same file simultaneously. When you pull changes from a remote repository using ",[41,42,43],"code",{},"git pull"," and encounter conflicts, it's important to know how to resolve them effectively. In this article, we'll explore how to resolve Git conflicts using Visual Studio Code.",[46,47,49],"h3",{"id":48},"understanding-git-conflicts","Understanding Git Conflicts",[37,51,52,53,55,56,59],{},"Before diving into conflict resolution, it's essential to understand what Git conflicts are. When you pull changes from a remote repository using ",[41,54,43],{},", Git attempts to automatically merge those changes into your local branch. However, conflicts occur when Git can't reconcile the differences between your local branch (also known as ",[41,57,58],{},"HEAD",") and the incoming remote changes.",[37,61,62],{},"Conflicts typically arise when:",[64,65,66,70],"ul",{},[67,68,69],"li",{},"You've modified the same part of a file that has been changed in the remote repository.",[67,71,72],{},"The remote changes are incompatible with your local changes.",[46,74,76],{"id":75},"using-visual-studio-code-for-conflict-resolution","Using Visual Studio Code for Conflict Resolution",[37,78,79],{},"Visual Studio Code (VS Code) provides a user-friendly interface for resolving Git conflicts. Here's a step-by-step guide on how to do it:",[81,82,84],"h4",{"id":83},"step-1-identify-the-conflicts","Step 1: Identify the Conflicts",[37,86,87,88,90],{},"When you run ",[41,89,43],{}," and conflicts occur, VS Code will immediately bring these conflicts to your attention. You'll see the affected files with conflict markers.",[81,92,94],{"id":93},"step-2-open-the-conflicted-file","Step 2: Open the Conflicted File",[37,96,97],{},"To resolve conflicts, open the conflicted file(s) in VS Code. You'll notice that the conflicting sections are marked with special conflict markers:",[99,100,104],"pre",{"className":101,"code":102,"language":103,"meta":11,"style":11},"language-plaintext shiki shiki-themes github-light github-dark","\u003C\u003C\u003C\u003C\u003C\u003C\u003C HEAD\n\u002F\u002F Your local changes\n=======\n\u002F\u002F Incoming changes from the remote repository\n>>>>>>> remote\u002Fbranch-name\n","plaintext",[41,105,106,114,119,125,131],{"__ignoreMap":11},[107,108,111],"span",{"class":109,"line":110},"line",1,[107,112,113],{},"\u003C\u003C\u003C\u003C\u003C\u003C\u003C HEAD\n",[107,115,116],{"class":109,"line":12},[107,117,118],{},"\u002F\u002F Your local changes\n",[107,120,122],{"class":109,"line":121},3,[107,123,124],{},"=======\n",[107,126,128],{"class":109,"line":127},4,[107,129,130],{},"\u002F\u002F Incoming changes from the remote repository\n",[107,132,134],{"class":109,"line":133},5,[107,135,136],{},">>>>>>> remote\u002Fbranch-name\n",[81,138,140],{"id":139},"step-3-review-and-merge","Step 3: Review and Merge",[37,142,143],{},"Carefully review the conflicting changes. You have the freedom to choose which changes to keep and which to discard. Here are your options:",[64,145,146,149,152],{},[67,147,148],{},"Keep your local changes and discard the remote changes.",[67,150,151],{},"Keep the remote changes and discard your local changes.",[67,153,154],{},"Combine both sets of changes to create a new merged version.",[37,156,157],{},"Edit the file to remove the conflict markers and craft the code according to your chosen merge strategy. This step might require some manual coding, so be sure to pay close attention to the code.",[81,159,161],{"id":160},"step-4-save-the-file","Step 4: Save the File",[37,163,164],{},"After you've successfully resolved the conflicts, save the file.",[81,166,168],{"id":167},"step-5-stage-and-commit","Step 5: Stage and Commit",[37,170,171],{},"Use the source control interface in VS Code to stage the resolved changes. Once you've staged all the resolved files, commit the changes. Be sure to add a meaningful commit message describing the conflict resolution.",[81,173,175],{"id":174},"step-6-complete-the-pull","Step 6: Complete the Pull",[37,177,178,179,181],{},"Now that you've resolved the conflicts and committed your changes, you can finish the ",[41,180,43],{}," operation. Git will update your local branch with the latest changes from the remote repository.",[46,183,185],{"id":184},"further-resources","Further Resources",[37,187,188],{},"To deepen your understanding of Git conflicts and conflict resolution, consider exploring these online resources:",[190,191,192,202,210],"ol",{},[67,193,194,201],{},[195,196,200],"a",{"href":197,"rel":198},"https:\u002F\u002Fgit-scm.com\u002Fdocs\u002Fgit-mergetool",[199],"nofollow","Git Documentation on Resolving Merge Conflicts",": The official Git documentation provides detailed information on resolving merge conflicts using various tools.",[67,203,204,209],{},[195,205,208],{"href":206,"rel":207},"https:\u002F\u002Fwww.atlassian.com\u002Fgit",[199],"Atlassian Git Tutorials",": Atlassian offers a comprehensive set of Git tutorials, including guides on conflict resolution.",[67,211,212,217],{},[195,213,216],{"href":214,"rel":215},"https:\u002F\u002Fdocs.github.com\u002Fen\u002Fgithub\u002Fcollaborating-with-issues-and-pull-requests\u002Fresolving-a-merge-conflict-on-github",[199],"GitHub's Guide to Resolving Merge Conflicts",": GitHub provides a step-by-step guide to resolving merge conflicts directly on the platform.",[46,219,221],{"id":220},"wrapping-up","Wrapping Up",[37,223,224,225,227],{},"Resolving Git conflicts is a crucial skill for any developer working in a collaborative environment. When conflicts arise during a ",[41,226,43],{},", Visual Studio Code provides a user-friendly way to handle them. By following the steps outlined in this article and exploring the recommended resources, you can efficiently resolve conflicts and keep your codebase in sync with your team's work.",[229,230,231],"style",{},"html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"title":11,"searchDepth":12,"depth":12,"links":233},[234],{"id":34,"depth":12,"text":35,"children":235},[236,237,238,239],{"id":48,"depth":121,"text":49},{"id":75,"depth":121,"text":76},{"id":184,"depth":121,"text":185},{"id":220,"depth":121,"text":221},"2023-09-01","Git is a powerful version control system that helps developers collaborate on projects seamlessly. However, in the world of collaborative coding, conflicts can arise when different team members make changes to the same file simultaneously.","\u002Farticles\u002Fimages\u002Fgit.png",{},"\u002Farticles\u002Fgit_resolve_conflicts_vscode",{"title":27,"description":241},"articles\u002Fgit_resolve_conflicts_vscode",[248,18],"git","qGIiwA6p8ljvPGjXB-kBwnv9xalFJigA20nnQQ13C4o",{"id":251,"title":252,"author":28,"body":253,"createdAt":379,"description":380,"extension":15,"img":242,"meta":381,"navigation":19,"path":382,"seo":383,"stem":384,"tags":385,"updatedAt":379,"__hash__":386},"articles\u002Farticles\u002Fgit_merge_conflicts.md","Resolving Merge Conflicts Enhance Your Understanding and Decision Making Skills",{"type":8,"value":254,"toc":372},[255,259,262,266,269,273,276,297,301,304,307,349,352,356,359,362],[46,256,258],{"id":257},"git-merge-conflicts-understanding-and-resolving-them","Git Merge Conflicts: Understanding and Resolving Them",[37,260,261],{},"Git is a powerful version control system used by developers to track changes made to their codebase over time.\nOne of the key features of Git is its ability to merge changes made by multiple developers into a single codebase.\nHowever, this process can sometimes result in conflicts that need to be resolved before the merge can be completed.\nIn this article, we'll take a closer look at git merge conflicts, why they occur, and how to resolve them.",[46,263,265],{"id":264},"what-are-git-merge-conflicts","What are Git Merge Conflicts?",[37,267,268],{},"Git merge conflicts occur when changes made by multiple developers to the same file or\nlines of code conflict with each other. Git is not able to automatically determine which changes should\nbe included in the final version, so it prompts the user to manually resolve the conflicts. Merge conflicts\ncan happen in any situation where multiple people are working on the same codebase, whether it's a\nsmall team or a large open-source project.",[46,270,272],{"id":271},"why-do-git-merge-conflicts-happen","Why Do Git Merge Conflicts Happen?",[37,274,275],{},"Git merge conflicts happen when two or more developers make changes to the same file or lines of code.\nThis can happen for several reasons, such as:",[64,277,278,285,291],{},[67,279,280,284],{},[281,282,283],"strong",{},"Parallel Development:"," When multiple developers are working on the same codebase, they may work on the same file or lines of code without realizing it.",[67,286,287,290],{},[281,288,289],{},"Time Lags:"," Sometimes, developers may work on the same file or lines of code at different times, and their changes conflict with each other.",[67,292,293,296],{},[281,294,295],{},"Code Complexity:"," As the complexity of the codebase increases, it becomes more challenging to avoid merge conflicts, especially when dealing with a large team of developers.",[46,298,300],{"id":299},"how-to-resolve-git-merge-conflicts","How to Resolve Git Merge Conflicts?",[37,302,303],{},"Resolving Git merge conflicts can be a bit daunting, especially for developers\nwho are new to the process. However, with some practice and patience, it's possible to become proficient at\nresolving merge conflicts.",[37,305,306],{},"Here are some steps you can follow to resolve Git merge conflicts:",[64,308,309,315,321,327,333,343],{},[67,310,311,314],{},[281,312,313],{},"Identify the Conflicting Files:"," When a merge conflict occurs, Git will highlight the files that have conflicts. You can use the command 'git status' to identify the files with conflicts.",[67,316,317,320],{},[281,318,319],{},"Open the Conflicting Files:"," Open the files with conflicts in your preferred text editor. Git will highlight the conflicting sections of the file.",[67,322,323,326],{},[281,324,325],{},"Understand the Conflict:"," Read through the conflicting sections of the file to understand what changes were made and why they conflict.",[67,328,329,332],{},[281,330,331],{},"Choose the Correct Changes:"," Decide which changes should be included in the final version of the file. You can keep one set of changes, discard both sets of changes, or merge the changes manually.",[67,334,335,338,339],{},[281,336,337],{},"Save the Changes:"," Once you've made the necessary changes, save the file and add it to the staging area using the command 'git add ",[340,341,342],"filename",{},"'.",[67,344,345,348],{},[281,346,347],{},"Commit the Changes:"," After resolving all conflicts, commit the changes using the command 'git commit'.",[37,350,351],{},"Be sure to watch the video resouce provided at the bottom of this post.  It was very helpful.",[46,353,355],{"id":354},"conclusion","Conclusion",[37,357,358],{},"Git merge conflicts are a common occurrence in the world of software development. They can be frustrating,\nbut they are also an opportunity to improve your collaboration skills and learn more about the codebase you're\nworking on. By understanding why merge conflicts happen and how to resolve them, you can become a more\nefficient and effective developer. Remember, practice makes perfect!",[37,360,361],{},"If you want to learn more check out some of the resources below:",[64,363,364],{},[67,365,366,367],{},"[Merge Conflicts](",[195,368,371],{"href":369,"rel":370},"https:\u002F\u002Fwww.youtube.com\u002Fwatch?v=HosPml1qkrg",[199],"https:\u002F\u002Fwww.youtube.com\u002Fwatch?v=0gA68g269NA",{"title":11,"searchDepth":12,"depth":12,"links":373},[374,375,376,377,378],{"id":257,"depth":121,"text":258},{"id":264,"depth":121,"text":265},{"id":271,"depth":121,"text":272},{"id":299,"depth":121,"text":300},{"id":354,"depth":121,"text":355},"2023-03-21","Current state of Google Flutter mobile application development",{},"\u002Farticles\u002Fgit_merge_conflicts",{"title":252,"description":380},"articles\u002Fgit_merge_conflicts",[248,18],"kKr_tSrf_WUYdKasSxMM-rxeUxgH7Pg3nWbQLGMHaEg",{"id":388,"title":389,"author":390,"body":391,"createdAt":520,"description":521,"extension":15,"img":390,"meta":522,"navigation":19,"path":523,"seo":524,"stem":525,"tags":526,"updatedAt":520,"__hash__":529},"articles\u002Farticles\u002Fsource-control-options-git-and-team-foundation-server-tfs.md","Source Control Options GIT and Team Foundation Server (TFS)",null,{"type":8,"value":392,"toc":516},[393,397,411,414,437,440,447,457,472,476,483,486,496,505,508],[46,394,396],{"id":395},"git-is-a-distributed-version-control-system","Git is a Distributed Version Control System",[64,398,399,405],{},[67,400,401,404],{},[281,402,403],{},"Each developer"," has the entire repository, including the entire change history on his\u002Fher local machine",[67,406,407,410],{},[281,408,409],{},"The developer"," can see changeset history offline or commit (check-in) changes offline to his local repository",[37,412,413],{},"Since the entire repository is local, we do everything locally. This includes, but not limited to:",[64,415,416,419,422,425,428,431,434],{},[67,417,418],{},"Committing changes (Check-in)",[67,420,421],{},"Viewing commit history",[67,423,424],{},"Creating a new branch",[67,426,427],{},"Merging branches",[67,429,430],{},"Moving to a different branch",[67,432,433],{},"Deleting branches",[67,435,436],{},"Reverting older commits",[37,438,439],{},"Yes we do have to Check-in or 'Push' our changes to the remote repository.",[37,441,442,443,446],{},"'Check-in' within Git is divided into ",[281,444,445],{},"2 parts",":",[37,448,449,452,453,456],{},[281,450,451],{},"Commit"," and **Push\n",[281,454,455],{},"Developers can now commit locally","whatever they want – Ugly code, comments, and work in progress. The other developers won’t get those changes as the commit is performed entirely local on their respective PC. When the code is ready for the team, they can Push the code changes to the remote repository.  This workflow gives the developer addition management of changes and when\u002Fhow things are pushed into the central repository for team consumption.",[37,458,459,460,463,464,467,468,471],{},"The ",[281,461,462],{},"Staging","concept …. this is like ",[281,465,466],{},"Included","\u002F",[281,469,470],{},"Excluded","changes in TFS. Only staged files will be committed. Again, why? (well say locally modified configuration files can stay out of source control)",[46,473,475],{"id":474},"branches-and-merges","Branches and Merges",[37,477,478,479,482],{},"In TFS\u002FTFSVC, ",[281,480,481],{},"Branch","will create a new directory with a copy of all files and directories of the parent Branch. For a developer to work on that new branch, they will have to copy that directory to his hard disk, essentially having another folder with the source code.",[37,484,485],{},"With Git, each branch is not a copy of the files from the parent branch. Instead, it’s simply a pointer to the Commit in the parent Branch from where we created our new branch.  With Git when working on a different branch, we tell Git “Move to another branch” (Checkout command) and Git will change our working area to match the desired branch. Again, there is a performance benefit as this entire action is performed locally.  Git already contains all the branches on the local machine.",[37,487,488,491,492,495],{},[281,489,490],{},"Merging"," is a lightweight operation. We can merge any branch to any branch. We can merge the entire difference or a specific Commit. Git will find the “Base” Commit where the branches split and allow us to resolve conflicts (This is the same as in TFS)",[493,494],"br",{},"\nA good practice with Git is to create a new branch to work on a big feature. Eventually, merging that branch to the master branch and discarding the new branch entirely.",[37,497,498],{},[195,499,504],{"href":500,"target":501,"rel":502},"https:\u002F\u002Fgit-scm.com\u002Fbook\u002Fen\u002Fv2\u002FGit-Branching-Branches-in-a-Nutshell","_blank",[503],"noopener","Reference\u002FTutorial on GIT branching",[37,506,507],{},"TFS\u002FTFVC is Centralized Version Control System",[64,509,510,513],{},[67,511,512],{},"the developer has a copy of the repository file system on his machine",[67,514,515],{},"offline actions like commits (check-ins)  and seeing history are impossible since the local repository can’t save “changes”",{"title":11,"searchDepth":12,"depth":12,"links":517},[518,519],{"id":395,"depth":121,"text":396},{"id":474,"depth":121,"text":475},"2020-01-21","Git has been gaining momentum lately and continues to be the path forward for all organizations (including Microsoft) as the source control of record.  What are the differences, benefits...read more...",{},"\u002Farticles\u002Fsource-control-options-git-and-team-foundation-server-tfs",{"title":389,"description":521},"articles\u002Fsource-control-options-git-and-team-foundation-server-tfs",[18,527,528,248],"teamfoundationserver","visualstudio","z27ZBLeINXv4DaOx5aV-Ihtuz5pCxHT3joVG2EXl5Z0",1781574760286]