Git walkthrough outlines the basics of using Git including source control, configuration, viewing history, undoing changes, tagging, branching, and hosting on platforms like GitHub. It discusses initializing and cloning repositories, adding, committing, and pushing changes. Specific commands are demonstrated for status checking, diffing, resetting, merging, and more. New features introduced in Git 2.0 such as improved defaults for push and add are also reviewed.
22. Tagging
● Lightweight: pointer to specific commit
$ git tag before-optimization
● Annotated: full objects, checksummed,
contains tagger info, suitable for
releases
$ git tag -a v1.4 -m 'my version 1.4'
23. Tagging
#Tagging later
$ git tag -a v1.2 9fceb02
$ git show v1.2
$ git push origin v1.5
$ git push origin --tags
24. Branching
$ git branch #List current branches
$ git branch newone # create a new branch newone
$ git checkout newone # switch to newone branch
# create branch and switch in one step
$ git checkout -b newtwo
36. Bare Repos
● git repo with no working directory
● The git server side
$ git init --bare .
# Cloning (backup)
$ git clone --bare git@github.com:modsaid/git-demo2.git
# Restoring
$ git push --mirror git@bitbucket.org:modsaid/git-demo2.git
37. Hosting: github, bitbucket
● Github: the most popular, free public repos
● Bitbucket: free private with limited
collaborators
● A lot others
41. What’s new in Git 2.0
“From the point of view of end-users who are totally new to
Git, this release will give them the defaults that are vastly
improved compared to the older versions, but at the same
time, for existing users, this release is designed to be as
low-impact as possible as long as they have been following
recent releases along.”
● Better Defaults
46. Resources
● Pro Git, Second Edition
By: Scott Chacon; Ben Straub
Publisher: Apress
Pub. Date: November 19, 2014
● git help COMMAND (man pages)
● Git Recipes by BasayelSaid