Git workshop
-
Upload
al-sayed-gamal -
Category
Technology
-
view
496 -
download
0
description
Transcript of Git workshop
![Page 1: Git workshop](https://reader036.fdocuments.in/reader036/viewer/2022081404/5594461c1a28ab02738b460f/html5/thumbnails/1.jpg)
![Page 2: Git workshop](https://reader036.fdocuments.in/reader036/viewer/2022081404/5594461c1a28ab02738b460f/html5/thumbnails/2.jpg)
GITWorkshop by @AlSayedGamal
![Page 3: Git workshop](https://reader036.fdocuments.in/reader036/viewer/2022081404/5594461c1a28ab02738b460f/html5/thumbnails/3.jpg)
AGENDA
• Introduction
• getting started
• git workflow
• Tips and tricks
• social coding (github)
![Page 4: Git workshop](https://reader036.fdocuments.in/reader036/viewer/2022081404/5594461c1a28ab02738b460f/html5/thumbnails/4.jpg)
INTRODUCTION
• What’s git and what’s VCS?
• git history
![Page 5: Git workshop](https://reader036.fdocuments.in/reader036/viewer/2022081404/5594461c1a28ab02738b460f/html5/thumbnails/5.jpg)
SH*T HAPPENSIf it’s not power outage it’s disk failure os failure,etc..
Sayevt ya Ali
![Page 6: Git workshop](https://reader036.fdocuments.in/reader036/viewer/2022081404/5594461c1a28ab02738b460f/html5/thumbnails/6.jpg)
WHAT ABOUT VCS THAT HANDLES LINUX ?The development of Git began on 3 April 2005. The project was announced on 6 April, and became self-hosting as of 7 April.
![Page 7: Git workshop](https://reader036.fdocuments.in/reader036/viewer/2022081404/5594461c1a28ab02738b460f/html5/thumbnails/7.jpg)
GIT CHARACTERISTICS• Strong support for non-linear
development
• Distributed development
• Compatibility with existing systems/protocols
• Efficient handling of large projects
• Cryptographic authentication of history
• Pluggable merge strategies
• Toolkit-based design(C & Shell)
![Page 8: Git workshop](https://reader036.fdocuments.in/reader036/viewer/2022081404/5594461c1a28ab02738b460f/html5/thumbnails/8.jpg)
HOW GIT STORES DATA
• git has three main types
• blob (binary large object)
• tree (basically tree of blobs)
• graph (directed graph of commits)
![Page 9: Git workshop](https://reader036.fdocuments.in/reader036/viewer/2022081404/5594461c1a28ab02738b460f/html5/thumbnails/9.jpg)
![Page 10: Git workshop](https://reader036.fdocuments.in/reader036/viewer/2022081404/5594461c1a28ab02738b460f/html5/thumbnails/10.jpg)
![Page 11: Git workshop](https://reader036.fdocuments.in/reader036/viewer/2022081404/5594461c1a28ab02738b460f/html5/thumbnails/11.jpg)
INSTALLING GIT• On centos you will always have
dependancies resolved.
• On ubuntu package name is git >= 12.04
• For mac I use homebrew however ports and fink should work the same.
• On windows give linux a chance or try cygwin it may be installed else go for msysGit >= 1.7.10
yum install git
apt-get install git
redhat
debian
brew install git
use linux or
mac
windows
install cygwin or msysGit
![Page 12: Git workshop](https://reader036.fdocuments.in/reader036/viewer/2022081404/5594461c1a28ab02738b460f/html5/thumbnails/12.jpg)
GETTING STARTED• Git the command line
• New repo
• New file
• Basic config
• First commit
• View difference
• Remove and rename files
• Copy your repo
![Page 13: Git workshop](https://reader036.fdocuments.in/reader036/viewer/2022081404/5594461c1a28ab02738b460f/html5/thumbnails/13.jpg)
BRANCHING AND MERGING
• git branch <branch name>
• git checkout -b <branch name>
• git checkout <branch name>
• git merge <other branch>
![Page 14: Git workshop](https://reader036.fdocuments.in/reader036/viewer/2022081404/5594461c1a28ab02738b460f/html5/thumbnails/14.jpg)
GIT FLOW BRANCHINGgit flow command line tool will help you structure your
app.
![Page 15: Git workshop](https://reader036.fdocuments.in/reader036/viewer/2022081404/5594461c1a28ab02738b460f/html5/thumbnails/15.jpg)
TIPS AND TRICKSThese tips will be used almost in every project.
![Page 16: Git workshop](https://reader036.fdocuments.in/reader036/viewer/2022081404/5594461c1a28ab02738b460f/html5/thumbnails/16.jpg)
IGNORE.gitignore files that shouldn’t be tracked.
Like .pyc files
![Page 17: Git workshop](https://reader036.fdocuments.in/reader036/viewer/2022081404/5594461c1a28ab02738b460f/html5/thumbnails/17.jpg)
BLAMEgit blame to know who is responsible of this change.
Try sublime (and your favourite IDE) blame integration.
![Page 18: Git workshop](https://reader036.fdocuments.in/reader036/viewer/2022081404/5594461c1a28ab02738b460f/html5/thumbnails/18.jpg)
TEST > PUSHBefore pushing make sure that you pass test
django hint: in .bachrc alias gpush to ./manage.py test & git push origin develop
./manage.py test # if all pass git push origin develop
![Page 19: Git workshop](https://reader036.fdocuments.in/reader036/viewer/2022081404/5594461c1a28ab02738b460f/html5/thumbnails/19.jpg)
STASH AND CLEAN
• git stash will clean your stage to the most recent commit.
• git stash apply to bring your mess again.
• Clean untracked files:
• git clean -d <path>
![Page 20: Git workshop](https://reader036.fdocuments.in/reader036/viewer/2022081404/5594461c1a28ab02738b460f/html5/thumbnails/20.jpg)
TAG
• git tag -a v1.0.0 -m "Creating the first release candidate”
• git show v1.0.0
![Page 21: Git workshop](https://reader036.fdocuments.in/reader036/viewer/2022081404/5594461c1a28ab02738b460f/html5/thumbnails/21.jpg)
GITHUB
• Normal Commercial membership.
• Star, watch and follow.
• pulse.
![Page 22: Git workshop](https://reader036.fdocuments.in/reader036/viewer/2022081404/5594461c1a28ab02738b460f/html5/thumbnails/22.jpg)
REFERENCES• gitready.com
• git-scm.com
• Book: version control with git 2nd edition - O’Reilly.
• wikipedia | en.wikipedia.org/wiki/Git_(software)
• github.com
![Page 23: Git workshop](https://reader036.fdocuments.in/reader036/viewer/2022081404/5594461c1a28ab02738b460f/html5/thumbnails/23.jpg)
QUESTIONS ?
![Page 24: Git workshop](https://reader036.fdocuments.in/reader036/viewer/2022081404/5594461c1a28ab02738b460f/html5/thumbnails/24.jpg)
GIT COMMIT -M “THANK YOU”