git: git'ing the basic

Download Git: Git'ing the Basic

If you can't read please download the document

Upload: gerald-villorente

Post on 16-Apr-2017

766 views

Category:

Technology


0 download

TRANSCRIPT

Git: Git'ing the Basic

Gerald VillorenteKite Systems Inc.

Drupal.IT / 06-01-2013 / Microsoft PH Makati City

Kite Systems Git me

What is Git?

Git (/t/) is a distributed revision control and source code management (SCM) system with an emphasis on speed.[3] Initially designed and developed by Linus Torvalds for Linux kernel development, Git has since been adopted by many other projects.

http://en.wikipedia.org/wiki/Git_(software)

Why Git?

Distributed (upstream/downstream)

Git has integrity (SHA-1)

Local and remote revisioning

Full history

Push/pull only requires internet

Fast

It's awesome!

Setup Git Identity

git config global user.name Captain Barbel

git config global user.email [email protected]

Create a New Repository

git init- Create an empty git repository or reinitialize an existing one

Checkout a Repository

git clone- Clone a repository into a new directory

git clone /path/to/repository

git clone username@host:/path/to/repository

Git Workflow

Add and Commit

git add- Add file contents to the index

git add

git add *

git add .

git commit- Record changes to the repository

git commit -m "Commit message"

git commit -am "Commit message"

Add and Commit

git add- Add file contents to the index

git add

git add *

git add .

git commit- Record changes to the repository

git commit -m "Commit message"

git commit -am "Commit message"

Pushing Changes

git push- Update remote refs along with associated objects

git push origin master

git push origin

git push

git push or git push

Adding Remote Repo Server

git remote add origin

git remote add

Branching

Branching

git checkout -b bayabas

Switching branch

git checkout okra

git branch -d alugbati

NOTE: a branch is not available to others unless you push the branch to your remote repository

git push origin talong

Update and Merge

git pull- Fetch from and merge with another repository or a local branch

git pull origin

git pull origin or git pull all

git fetch origin- Download objects and refs from another repository

git diff

git merge

git merge -m Message

Conflict during Merge

Use diff tool or git diff command

git add

Tagging

git tag 1.0.0 1b2e1d63ff

Replace Local Changes

git checkout --

git pull rebase

git reset hard origin/

git clean -f

Git Useful Commands

git status- Show the working tree status

git log- Show commit logs

git show- Show various types of objects

git fetch- Download objects and refs from another repository

git log --oneline

Categorization

Categorization

Categorization

Categorization

Categorization

Questions?

References

http://rogerdudler.github.io/git-guide/

http://git-scm.com/book

https://na1.salesforce.com/help/doc/en/salesforce_git_developer_cheatsheet.pdf

http://ndpsoftware.com/git-cheatsheet.html