GIT version control. What is GIT Have you ever wished you could travel back in time when you develop...

16
GIT version control

Transcript of GIT version control. What is GIT Have you ever wished you could travel back in time when you develop...

Page 1: 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.

GIT version control

Page 2: 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.

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

Page 3: 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.

What do I need

https://code.google.com/p/gitextensions/http://git-scm.com/

Page 4: 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.

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

Page 5: 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.

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

Page 6: 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.

Congratulations – That’s it!

• Now you know how to use GIT

Page 7: 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.

Version control, using Git 7

Git Extensions, .gitignore

1. Click “Add default ignores” button

2. Add a few more like .exe etc.3. Click the “Save” button

Page 8: 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.

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

Page 9: 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.

Some Details… Merging

Page 10: 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.

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.

Page 11: 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.

Version control, using Git 11

Working with a remote repositoryFigure from http://git-scm.com/book/en/Distributed-Git-Contributing-to-a-Project

Page 12: 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.

Github.com || BitBucket.org

• Github is free for open source projects (use general open port)• Bitbucket offers a free closed project for 5 memebers

Page 13: 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.

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…

Page 14: 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.

‘Feature Branch Workflow’

Page 15: 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.

Resources

• A free book onlinehttp://git-scm.com/book

• Videoshttp://git-scm.com/video/

• PDF: Git Magic by Ben Lynn

• Console online training