Loading presentation...

Present Remotely

Send the link below via email or IM

Copy

Present to your audience

Start remote presentation

  • Invited audience members will follow you as you navigate and present
  • People invited to a presentation do not need a Prezi account
  • This link expires 10 minutes after you close the presentation
  • A maximum of 30 users can follow your presentation
  • Learn more about this feature in our knowledge base article

Do you really want to delete this prezi?

Neither you, nor the coeditors you shared it with will be able to recover it again.

DeleteCancel

Make your likes visible on Facebook?

Connect your Facebook account to Prezi and let your likes appear on your timeline.
You can change this under Settings & Account at any time.

No, thanks

Intro to Git and Github

No description
by

Tome Tanasovski

on 4 June 2014

Comments (0)

Please log in to add your comment.

Report abuse

Transcript of Intro to Git and Github

Intro to Git and Github
Github History
Andrew Tridgell
2005
Linus Torvalds
Larry McVoy
Tarballs and E-mail
Git History
"If you are not distributed, you are not worth using, it's that simple.

If you perform badly, you are not worth using, it's that simple.

And If you cannot guarantee that the stuff I put into an SCM is exactly the same, you're not worth using"
--- Linus Torvalds
CVS/SVN/TFVC
Monolithic Central Repository

Check out/Check in

No transparency about what others are doing

Monolithic changes with no history

Difficult to merge
"We literally used tarballs and patches which is a much superior source control managment system than CVS is"
"... my hatred of CVS means I see Subersion as the most pointless project ever started ..."
"CVS users, if you actually like using CVS, you - you shouldn't be here. You should be in some mental institution somewhere else"

"In many ways when I designed git, it was the what would Jesus do, except it's what would CVS never ever do kind of approach to source control management."

History of Git
"I can write something better than anything out there in two weeks, and I was right" - Linus - 2007
April 2005 Development Begins
April 2005 Expected benchmarks met
June 2005 Linux kernel release was on Git
July 26 Junio Hamano takes over maintenance
December 2005 Git 1.0 released
General Requirements
Distributed (like bitkeeper)
Merges down to 3 seconds
Merges easy
Strong safeguards against corruption
Comatibility with existing protocols (ssh, HTTP, FTP)
Deal with large projects
Note: Mercurial also created in 2005 and is nearly identical to Git.
Using Git
Create a Repo
git init
Signifies that you are in the master branch
Make a Change
Create/Modify Code
Ensure that your files are not UTF-16 or you will not be able to see changes in diffs
Commit Changes
git status
New files to add
Displays a status of what is staged to be committed and what can be staged for commit.
Modified Files
Files removed
Red
Green
- Change exists, but not yet added to be committed
- Change added for commit
git add & git rm
add - Adds a file that is new or has been changed to the staging area for commit
rm - Stages a delete commit for a file that has been deleted
-A ensure that all changes are added (including deletes)
git commit
Commits a change to the repository in the active branch.

-m is a mandatory parameter that takes a string value for a comment about the commit
View the Change
(Diff)
git diff
displays the changes that were made and can be staged for commit
Branch Code
git checkout
Switches your active branch
-b creates a branch with that name, and then switches you to it
Note: You should only branch after you have committed at least one thing to master
git branch
Displays branches
file that is changed
lines removed
lines added
View Commits
git log
Displays a list of all the commits with their commit message
git diff
Used with commit IDs to see differences between commits
commit ID
Merge Branches
git merge
Merges the named branch into the current one
Undoing Things
git comit --amend
Amends data that is staged for comit to the last commit.
git reset
Removes the last commit
git revert
Undo a commit by creating a new commit that undoes the changes
You will be allowed to modify the commit message
After reset the files will not be staged
Other Fixes
Google - Everything can be done and undone in Git

rebase

cherry-pick

Help
git help command
Displays help for any git command

ex: git help commit
Cheat Sheet
init
- Creates a repo

checkout branchname
- Switches your active branch

checkout -b branchname
- Creates a branch with that name, and then switches you to it

branch
- Displays branches

status
- Displays a status of what is staged to be committed and what can be staged for commit

add filename
- Adds a file that is new or has been changed to the staging area for commit

add -A
- Adds all changes to the staging area (including deletes)

rm
- Stages a delete commit for a file that has been deleted

status
- Displays a status of what is staged to be commited and what can be staged for commit

diff
- Displays the changes that have been made

commit -m "message"
- Commits a change

commit --amend
- Applies the staged files to the last commit

log
- Displays a summary of all commits

merge branchname
- Merges the specified branch into the current branch

reset commitID
- Removes the last commit

revert commitID
- Undo a commit by creating a new commit that undoes the changes


"I'm an egotistical bastard, and I name all my projects after myself. First 'Linux', now 'git'."

--- Linus Torvalds
locally
Launched in 2008
Using Github
Fork a Repo
git init
Signifies that you are in the master branch
Push to Github
git push
Discuss
Pull Request

Work Locally
git clone
Clones a git repository locally
Gists
Distributed
Pushes a branch to a remote repository
origin is the default name for remote repositories
Tome Tanasovski
http://twitter.com/toenuff
http://powertoe.wordpress.com



http://techstravaganza.com
Full transcript