PDC - Meetup Session
30th July 2016
@GS labs
Version Control Systems
or
Revision Control Systems
or
Source Control Systems
Source : img src
Local VCS
Source : Github doc
Distributed VCS
{Git }
Central VCS
Source : Github doc
Speed
Simple design
Strong support for non-linear development
Fully distributed
Able to handle large projects like the Linux kernel efficiently (speed and data size)
Source : Github doc
The main reference : https://git-scm.com/
30 mins Crash course : https://try.github.io/
Other References : https://www.atlassian.com/git/
Github Resources : https://enterprise.github.com
Snapshots, Not Differences
Most VCS do :
: What Git does
Source : Github doc
"24b9da6552252987aa493b52f8696cd6d3b00373"
Source : Github doc
The Three States
Source : Github doc
$ sudo apt-get install git-all
$ sudo yum install git-all
Fedora Users
Ubuntu Users
Source : Github doc
Download : http://git-scm.com/download/mac
Download : http://git-scm.com/download/win
Source : Github doc
Platforms: Windows, Mac
Price: Free
Platforms: Windows, Mac, Linux
Price: Free
Source : Github doc
Flow of git commands and repos
Source : Blog
$ git add <list of files>
$ git add -all / -A
$ git add *.doc
$ git add "*.cpp"
Adding list of files
Adding all files
Adding files with extensions
Adding all files with specific extensions in a directory
removing list of files from the staging area
$ git reset HEAD <file>
Source : Blog
Source : Blog
Making commits on a repo
$ git commit -m "message related to commit"
Source : Blog
$ git commit -a
$ git commit
Commit everything
one line commit with message
$ git reset --soft HEAD^
$ git commit --amend
$ git reset --hard HEAD^
Undo last commit, put changes to staging
Change the last commit
Undo last commit and all changes
Source : Blog
Know your past, to get ready for the future..
$ git log --since=date --until=date
display's log with all commits till date
display's log with all commits from date - till date
$ git log
display's log with all commits ewith formating
$ git log --pretty=
Checkout
Revert
Reset
$ git checkout {commit}
$ git revert {commit}
$ git reset {commit}
Remove files from staging area
$ git reset {commit} -hard
Remove files from staging area
and working directory.
undo a commit
get to commit
Making difference....
$ git diff --staged
Difference between staged changes and working directory
Difference between staged changes and last commit
$ git diff
Difference between commits
$ git diff {commit} {commit}
$ git diff HEAD
Difference between current state and last commit
Source : Blog
Source : Blog
Source : Blog
Branching
Disscussions
Colaborating
fetch
pull
push
$ git fetch {remote}
$ git pull {remote}
$ git push {remote}
update remote repo
get a repo
fetch a repo
$ git fetch {remote} {branch}
$ git pull {remote} {branch}
$ git push {remote} {branch}
Source : Photo
Branching
Merge
Fork
Source : Blog
Source : Photo
$ git branch {branch name}
Display list of all branch
Create a branch
$ git branch
Create and switch in one go
$ git checkout -b {branch name}
$ git checkout {branch name}
Switch to a branch
Show branch details
$ git remote show origin
$ git branch -d {branch name}
remove a branch
$ git branch -D {branch name}
remove a branch forcefully
$ git push origin :{branch name}
Delete a remote branch
Source : Photo
$ git checkout {branch name}
Swtich to branch where you have to merge
$ git merge {branch name}
Merge with the branch you want
Source : Photo
Source : Photo
Source : Photo
Source : Photo
Source : Photo
Source : Photo
The golden rule of git rebase is to never use it on public branches.
Source : Blog
Head to : https://pages.github.com/
$ git branch ph-pages
Clone a repo
Create a branch : "gh-pages"
$ git clone {renmote}
$ git checkout gh-pages
Switch to a branch
$ git add .
$ git commit -m "message"
$ git push origin gh-pages
add, commit and push
Live world wide
HTML + CSS + MarkDown
The main reference : https://pages.github.com/
30 mins Crash course : https://help.github.com/articles
/creating-project-pages-manually/
Markdown References : https://guides.github.com/features
Github References : https://help.github.com/articles/
Clone a repo
$ git clone {remote}
$ git add .
$ git commit -m "message"
$ git push origin master
add, commit and push to main branch
What is Jekyll ??
~ $ gem install jekyll
~ $ jekyll new Meri-Website
~ $ cd Meri-Website
~/Meri-Website $ jekyll serve
# => Now browse to http://localhost:4000
Pre-requisites
Command
.
├── _config.yml
├── _drafts
| ├── begin-with-the-crazy-ideas.textile
| └── on-simplicity-in-technology.markdown
├── _includes
| ├── footer.html
| └── header.html
├── _layouts
| ├── default.html
| └── post.html
├── _posts
| ├── 2007-10-29-why-every-programmer-should-play-nethack.textile
| └── 2009-04-26-barcamp-boston-4-roundup.textile
├── _data
| └── members.yml
├── _site
├── .jekyll-metadata
└── index.html
PDC - Meetup Session
30th July 2016
@GS labs