Show & tell - Git on up!
-
Upload
dandineenuob -
Category
Internet
-
view
102 -
download
0
Transcript of Show & tell - Git on up!
What is Git?
Git is a version control system.
We use it to manage code & assets in a centralised, shareable location.
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.
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!
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)
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!
You need to rebase, James
Go back in time, alter history, rewrite the future.
our-repo
COMMIT!
COMMIT!
REBASE!!