show & tell - git on up!

21
Git on up!

Upload: dandineenuob

Post on 15-Apr-2017

105 views

Category:

Internet


0 download

TRANSCRIPT

Git on up!

What is Git?

Git is a version control system.

We use it to manage code & assets in a centralised, shareable location.

Git != Github

Git is a set of commands for versioning assets

GitHub is an online service for storing code* (We have a localised Enterprise version on bath.ac.uk)

* Other services are available

GitHub uses Git.

Git is stuffed full of jargon.

JAMES BROWNWeb Developer

As James Brown, web developer, I need somewhere to save versions of my code so I can easily roll back

if I make a mistake!

You need a Git Repository, James

A place for your code Repos can be local and remote

Multiple people can commit to the same repo

my-repo

<code>

As James Brown, web developer, I want to try out some sharp moves without affecting everything else in

my repository.

You need to create a branch, James

An ‘offshoot’ inside your repository. Branches can be merged back in to the main repo.

my-repo

! OMG!<code>

As James Brown, web developer, I want to save changes I've made to

my code so I don't lose them all!

You need to Commit, James

The act of adding code or assets to your repository.

my-repoCOMMIT!<code>

As James Brown, web developer, I want both my local & remote repos

to be in sync so that everyone always has the latest code.

Pull - Get changes from the remote repo

Push - Send local changes to the remote repo

Fetch - Check for changes on the remote repo

You need to push, pull or fetch, James

my-repo(Local)

my-repo(Remote)

As James Brown, web developer, I want to save my changes but I'm

not ready to commit them yet.

You need to stash your changes, James

You have changes but you aren't ready to commit them all yet. Stash them away for future use.

BTW Git can do unlimited stashes. Nice.

my-repo<code>

STASH!

As James Brown, web developer, I need to change the past so that I

can save the future!

You need to rebase, James

Go back in time, alter history, rewrite the future.

our-repo

COMMIT!

COMMIT!

REBASE!!

Tom Natt explains rebasing

Why ‘Git’?

I'm an egotistical b*stard. I name all my projects after

myself. First 'Linux', now 'Git'.

Linus Torvalds