Version Control
Based on the materials by
Mike Jackson, Katy Huff, Paul Ivanov, Rachel Slaybaugh, Anthony
Scopatz, and Gre...
With version control we can…
• Keep track of changes like a lab notebook for code
and documents
• Roll back changes to any...
Different version control systems
• Centralized version control, for example SVN
• Distributed version control, for exampl...
Git
•

Distributed version control

•

Very powerful

•

Widely used

•

May seem a steep learning curve but it’s well wor...
Distributed version control
Local
Working
copy

commit

Remote
push

add
checkout

pull

Staging area (git add….)
http://s...
Commits

i87hks

hni686ad

commi
t

abjgd687

commi
t

khd76enak

commi
t

HEAD

http://software-carpentry.org
Commits - checkouts

i87hks

hni686ad

abjgd687

commi
t

commi
t

khd76enak

commi
t

git checkout hni686ad
HEAD

http://...
Branching
MASTER
i87hks

hni686ad
commi
t

abjgd687
commi
t

khd76enak
commi
t

branch (git checkout –b feature1)

commi
t...
Merging a branch
MASTER
abjgd687

hni686ad

i87hks
commi
t

commi
t

branch (git checkout –b feature1)

khd76enak
commi
t
...
Working with remote repository
Local
Working
copy

commit

checkout

My laptop

Remote
push

pull

GitHub

http://software...
Working with remote repository
Remote

pull

push
pull
Working
copy

commit

push
Working
copy

commit

checkout

checkout...
Workflows and best practices

• Thinking about joining and contributing to
project that uses a version control?
• Check th...
Upcoming SlideShare
Loading in …5
×

Software Carpentry - Version control slides

621 views

Published on

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
621
On SlideShare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
5
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Software Carpentry - Version control slides

  1. 1. Version Control Based on the materials by Mike Jackson, Katy Huff, Paul Ivanov, Rachel Slaybaugh, Anthony Scopatz, and Greg Wilson Copyright © Software Carpentry 2013 This work is licensed under the Creative Commons Attribution License See http://software-carpentry.org/license.html for more information.
  2. 2. With version control we can… • Keep track of changes like a lab notebook for code and documents • Roll back changes to any point in the history of changes to our files • Back up our entire history of changes in various locations • Work on our files from multiple locations • Identify and resolve conflicts when the same file is edited within two repositories without losing any work • Collaboratively work on code or documents or any other files http://software-carpentry.org
  3. 3. Different version control systems • Centralized version control, for example SVN • Distributed version control, for example Mercurial or Git • Remote repositories hosting services, for example GitHub and BitBucket • Ask about a repository at your research institution! http://software-carpentry.org
  4. 4. Git • Distributed version control • Very powerful • Widely used • May seem a steep learning curve but it’s well worth it! http://software-carpentry.org
  5. 5. Distributed version control Local Working copy commit Remote push add checkout pull Staging area (git add….) http://software-carpentry.org
  6. 6. Commits i87hks hni686ad commi t abjgd687 commi t khd76enak commi t HEAD http://software-carpentry.org
  7. 7. Commits - checkouts i87hks hni686ad abjgd687 commi t commi t khd76enak commi t git checkout hni686ad HEAD http://software-carpentry.org
  8. 8. Branching MASTER i87hks hni686ad commi t abjgd687 commi t khd76enak commi t branch (git checkout –b feature1) commi t FEATURE1 http://software-carpentry.org
  9. 9. Merging a branch MASTER abjgd687 hni686ad i87hks commi t commi t branch (git checkout –b feature1) khd76enak commi t git merge feature1 commi t FEATURE1 http://software-carpentry.org
  10. 10. Working with remote repository Local Working copy commit checkout My laptop Remote push pull GitHub http://software-carpentry.org
  11. 11. Working with remote repository Remote pull push pull Working copy commit push Working copy commit checkout checkout Aleksandra John http://software-carpentry.org
  12. 12. Workflows and best practices • Thinking about joining and contributing to project that uses a version control? • Check their workflow and recommended practice (for example, each new feature in a new branch). • If in doubt, ask questions! http://software-carpentry.org

×