GIT version control What is GIT • Have you ever wished you could travel back in time when you develop a project…? • Have you ever wished you could collaborate with your friend on the same project or file at the same time…? • Ever wished you had a fast reliable and secure backup…? • GIT offers a remote backup, a possibility to load the project just before the disaster and an easy way to collaborate with your fellow students What do I need http://git-scm.com/ https://code.google.com/p/gitextensions/ Git Extensions • Git has a console line interface • Git Extensions offers a GUI to ease your daily work with GIT • Git Extensions will install a plugin into your visual studio when you install it • In order to do solve some ‘merge conflicts’ you should install kdiff3 Get your project under control • Execise • Install both ‘GIT’ and ‘GIT Extensions’ • Restart your visual studio and locate the new plugin in the top left corner • • • • • Create a new project Click on the yellow folder Click yes to initialize a new git repository Click commit and add your project to git Make some changes and commit again • Make some changes and commit again • Make some changes and commit again • Make some changes and commit again Congratulations – That’s it! • Now you know how to use GIT Git Extensions, .gitignore 1. Click “Add default ignores” button 2. Add a few more like .exe etc. 3. Click the “Save” button Version control, using Git 7 Some Details… Branches • In the previous exercise we avoided conflicts because we didn’t step back and worked alone. • Imagine we change our mind and wants to step back and continue working Some Details… Merging Collaboration / backup • Git is a decentralized distributed version control system • If you create a remote repository somewhere you have still have an exact copy on your local machine. • If you share your remote repositiory with fellow students they get a exact copy of the repository. Working with a remote repository Figure from http://git-scm.com/book/en/Distributed-Git-Contributing-to-a-Project Version control, using Git 11 Github.com || BitBucket.org • Github is free for open source projects (use general open port) • Bitbucket offers a free closed project for 5 memebers Exercise • Make a team of 4-5 people • Create a project on one computer add it to bitbucket or github • Follow the online wizard to upload a repository • Add the rest of the team to the remote repository • Commit to the projects and solve the conflicts… ‘Feature Branch Workflow’ Resources • A free book online http://git-scm.com/book • Videos http://git-scm.com/video/ • PDF: Git Magic by Ben Lynn • Console online training Using Git in Visual Studio • http://msdn.microsoft.com/en-us/library/hh850437.aspx • http://stackoverflow.com/questions/19982053/how-do-i-add-anexisting-solution-to-github-from-visual-studio-2013