• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Git It
 

Git It

on

  • 611 views

Quick presentation given a bunch of weeks ago fro our predocs primer.

Quick presentation given a bunch of weeks ago fro our predocs primer.

It's very basic overview of git, with some nice links at the end.

Statistics

Views

Total Views
611
Views on SlideShare
611
Embed Views
0

Actions

Likes
0
Downloads
10
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Git It Git It Presentation Transcript

    • Git It! Michele Mattionimattioni@ebi.ac.uk @mattions
    • <1>
    • My ideal version control system● Fast● Flexible● Offline● Smart
    • CVS/SVN● CVS: – I never used CVS. Im too young.● SVN: – I cant commit locally – I cant branch as I wish – The Merging just doesnt work. – All the operation are on-line. (No connection no cookies)
    • Bazaar● Good things: – No network needed – Really cool way to export your code in a tarball● Problems: – SVN interface didnt work properly – Branching and merging is ok but not as fast as git.
    • What is Git?Git is an opensource distributed verson control system which makes you happy.
    • Hey, but I work alone!● Do you develop in linear fashon?● Do you usually make a massive commit and then you cant track what you had really changed?
    • Or... I have just a bunch of files● Dont you change them quite often?● Dont you need to keep track of what is going on?● ...
    • </1>
    • <2>
    • Different Way of thinking: Delta Storage
    • Local Rules: With No Network you can:● Performing a diff● Viewing file history● Committing changes● Merging branches● Obtaining any other revision of a file● Switching branches
    • Non Linear Development: Try your ideas
    • Freedom!!!!
    • You can move around a lot of branches and try different things$ git checkout -b feature_x#hack #hack$ git commit -am ”Adding new feature_x”$ git checkout master$ git merge feature_x Its fast You retain control
    • </2>
    • <3>
    • Basic use: git init – Init a new repositorygit add file1-- Add file1 to the repogit commit -m ”My first initial commit” -- Commit
    • Stage Idea
    • add a file you dont commit it but you put it in the index
    • If you just add a file this is staged but not committed
    • Commit: You commit everything that you have added
    • When you commit the file is recorded in the repo.
    • Scenario File1 -- Correct a typoFile2 -- introduced a new methodFile3 -- Introduced new method
    • Control gives you flexibility$ git add file1$ git commit -m ”corrected a typo.”$ git add file2 file3$ git commit -m ”Introduced the newfeature to land on the moon.”
    • Mantra: Small commit are goodDo a lot of commit and divide your change logically in small part. It will help you a lot when you will break everything (and you will...)
    • -a switchgit commit -am ”I commit all 3 files in one go.”
    • </3>
    • <4>
    • Working online$ git push origin master$ git pull origin masterCan be any branch$ git push origin feature_x
    • github.com/edu
    • Github is just good
    • Easy docs for your project hosted automatically
    • Nice way to collaborate
    • </4>
    • Bonus info#git branchparse_git_branch() {git branch 2> /dev/null | sed -e /^[^*]/d -e s/* (.*)/(1)/}#greyPS1=[33[0;32m]u[33[1;32m]@ [33[0;32m]h[33[00m]: [33[01;34m]W[33[1;30m]$ (parse_git_branch)[33[00m]$
    • Results
    • Useful resources: Git http://git-scm.com/ Github http://github.com Nice guide http://rogerdudler.github.com/git-guide/ my profile https://github.com/mattionsCredits: Some of the slides were taken from Scott Chacon https://github.com/schacon