Git scm

46
| Source code Management System By @khasathan SWT Tech Share

description

GIT Source code Management System

Transcript of Git scm

Page 1: Git scm

| Source codeManagement System

By @khasathan

SWT Tech Share

Page 2: Git scm

In software development …

When you want to versioning.How do you do?

Page 3: Git scm

SRC/MY_CODE

Page 4: Git scm

SRC/- MY_CODE_ORG- MY_CODE_OLD- MY_CODE_NEW- MY_CODE_V1- MY_CODE_V2- MY_CODE_V...

Page 5: Git scm

And When you work with your team ...

Have you ever had these problems?

Page 6: Git scm

“Ahhh...Yesterday it work. Now, I get some error. Why?”

“I wrote my code here then It's missing.”

Page 7: Git scm

“What's changed?”

“This version bugs. We must revert to previous version.”“OMG! I don't back up.”

Page 8: Git scm

How we track our code?

Page 9: Git scm

Source code Management System

● Collaborate tool● Code versioning● Backup your code

Page 10: Git scm

Centralized VS Distributed (1)

Repository

Developers

Page 11: Git scm

Centralized VS Distributed (2)

Remoterepository

Localrepository

Localrepository

Localrepository

Localrepository

Master Developers

Page 12: Git scm

SCM bacsic concept

● Commit● Branch● Tag

Page 13: Git scm

GIT Timeline

Commit Tag

Branch

Page 14: Git scm

Why GIT?

● Distributed SCM● Freedom to play● Freedom to branch● Open source● Free code hosting and Collaborate tools

Page 15: Git scm

Clone Methods

● HTTP/HTTPS● SSH

Page 16: Git scm

Clone via Public Key

Page 17: Git scm

Let's Try!

Page 18: Git scm

Startup for Exist project (1)

$mkdir my_project/

$cd my_project/

$git init

$git remote add origin http://mydomain.com/user/try_git.git

Page 19: Git scm

Startup for Exist project (2)

$touch README

$git add .

$git commit -m “my first commit”

$git push origin master

Page 20: Git scm

Clone project from repo

$git clone [email protected]:user/try_git.git

$cd try_git/

...

Ready to work!

Page 21: Git scm

Branching

$git branch

* master

$git branch feature1

$git checkout feature1

Switch to branch 'feature1'

Page 22: Git scm

GIT Timeline

Feature1 branch

Page 23: Git scm

Merging

$git checkout master

Switch to branch 'master'

$git merge feaure1

Page 24: Git scm

GIT Timeline

Feature1 merge

Page 25: Git scm

Tagging

$git tag v1.0

or

$git tag -a RC1 -m “first release candidate”

Page 26: Git scm

GIT Timeline

Tag RC1

Page 27: Git scm

Ignoring File

● .gitignore● Accept files your don't automatically add them to repository

Page 28: Git scm

Pull Request / Merge Request

● Tell others about changes you've pushed to repository● The way for contributor submit new code to repository

Page 29: Git scm

Pull Request Workflows

Remoterepository

Master

Submit request

Feed back to developer

Fork/Clone

Contributor

Page 30: Git scm

Can we use GIT as CLI only?

Page 31: Git scm

NO! Many GUI programs available

for GIT

Page 32: Git scm

GIT UI Clients (1)

Page 33: Git scm

GIT UI Clients (2)

Page 34: Git scm

Collaborate Tools

● Free code hosting, social coding ● GitHub – public as default, pay for private● BitBucket – private, public project

● Self hosted GIT application e.g. GitLab

Page 35: Git scm

GitLab

● GIT (Gitolite)● Wiki● Issues● Code review, comment● Administrator (user, group, project)

Page 36: Git scm

GitLab - Overview

Page 37: Git scm

GitLab – Navigations (1)

Page 38: Git scm

GitLab – Navigations (2)

Page 39: Git scm

GitLab – Create Project (1)

Page 40: Git scm

GitLab – Create Project (2)

Page 41: Git scm

GitLab – Create Project (3)

Page 42: Git scm

GitLab – Public Key

Page 43: Git scm

GitLab – Dashboard

Page 44: Git scm

GitLab – Issue

Page 45: Git scm

GitLab – Wiki

Page 46: Git scm

Q & A