web programming - git basics

9
Internet Programming II Yildiz Technical University 2015 Using Git Ömer Taşkın

Upload: oemer-taskin

Post on 15-Jul-2015

185 views

Category:

Education


0 download

TRANSCRIPT

Page 1: Web Programming - Git basics

Internet Programming IIYildiz Technical University 2015

Using Git

Ömer Taşkın

Page 2: Web Programming - Git basics

OUTLINE

• What is git?

• Initializing git Repository

• git add

• git commit

• git push

• git pull

IP II - Git 2

Page 3: Web Programming - Git basics

What is git?

IP II - Git 3

Git is most known and best version control system.

Git provides:

• Versioning

• Source history & logs

• Working with development team etc.

Page 4: Web Programming - Git basics

Initializing Existing Repository

IP II - Git 4

We’ve git repository @github

git clone https://github.com/taskinomer/gittest.git

First step is clone to review or change. Git creates directory with project name.

Page 5: Web Programming - Git basics

git add

IP II - Git 5

We have git repository now on and want to store new files in git repository.

Create new file with name “test” and

git add test

or this command stashes all files

git add .

Page 6: Web Programming - Git basics

git commit

IP II - Git 6

We have created test file. But it's not in git repository yet. git commit command

provides to store sources locally.

-m option is commit message command. Every commit has to have a message!

git commit test -m "test commit"

git wants to know who am I (for only first commit)

git config --global user.name "username”

git config --global user.email "email"

Page 7: Web Programming - Git basics

git push

IP II - Git 7

It helps us to sending version to remote repository (in this case remote is github)

git push

Page 8: Web Programming - Git basics

git pull

IP II - Git 8

Gets changes from remote repository

git pull

Page 9: Web Programming - Git basics

QUESTIONS

IP II - Git 9