Presentation is loading. Please wait.

Presentation is loading. Please wait.

Peter Ogden and Josh Levine.  Motivation  High level overview  Walk through the common operations  How not to break things (too badly)

Similar presentations


Presentation on theme: "Peter Ogden and Josh Levine.  Motivation  High level overview  Walk through the common operations  How not to break things (too badly)"— Presentation transcript:

1 Peter Ogden and Josh Levine

2  Motivation  High level overview  Walk through the common operations  How not to break things (too badly)

3  Detailed usage  Command reference  Internal functionality  Advanced topics

4  Do you… ◦ Use more than one computer? ◦ Collaborate? ◦ Break stuff in unknown ways? ◦ Backup?

5  Widely used in the open source community ◦ Linux, KDE, LLVM, Github  Supported natively in CAS  Available for every platform  Wide variety of tools and interfaces  Offline working

6

7  Visible files ◦ Current state of the folder  Hidden history ◦ Collection of commits ◦ Reference to the current commit

8  Contains a diff  Has metadata ◦ Message ◦ Time ◦ Author  Linked to previous commit  Commit ID is the hash of everything

9

10  All communication is explicit  Push to put things in a remote repository  Pull to bring things from a remote repository

11 Setting up a new repository

12  Terminology ◦ Tracked – files known to git ◦ Index – files to be committed ◦ Staged – changes in the index adding Untracked Unstaged committing In indexCommitted

13 Committing and pushing

14  Two stages in pulling ◦ Fetch all commits from the remote server ◦ Update the local version with remote changes  Conflicts ◦ Someone else may have changed the file ◦ Git will try to apply all changes ◦ May require help

15

16 The push will fail - “non fast-forward”

17

18 Collaborative working

19  Only add files you mean to ◦ thumbs.db ◦.trash ◦ vim temporary files  Failing to pull before a push  Make sure everything is committed before pulling

20

21  Set name and email ◦git config --global user.email pko11@ic.ac.uk ◦git config --global user.name “Peter Ogden”  Initialise an empty repository ◦git init  Committing work

22  Create remote repository - e.g. on ee-casgit  Add remote server ◦ git remote add origin git@ee-casgit:pko11_test  Push to server ◦ git push origin HEAD Remote to push to Commit to push

23  What is the current state of the repository? ◦git status  What has changed since last commit? ◦git diff  What is currently in the index? ◦git diff --cached  What was the last commit? ◦git show  What are all the commits before the current? ◦git log  Graphical view of history ◦gitk


Download ppt "Peter Ogden and Josh Levine.  Motivation  High level overview  Walk through the common operations  How not to break things (too badly)"

Similar presentations


Ads by Google