code versioning with git

16

Click here to load reader

Upload: samuel-okoroafor

Post on 07-May-2015

243 views

Category:

Technology


0 download

DESCRIPTION

This are slides for my presentation on using Git at GDG DevFest akure, Ondo state, Nigeria. Enjoy!

TRANSCRIPT

Page 1: Code versioning with git

Code versioning with Git(from zero to hero)

@Samuel_NEThttp://about.me/okoroaforsamuel

Page 2: Code versioning with git

Introduction- What is Git?

- Why use Git?

Code Versioning with Git

Page 3: Code versioning with git

Code Versioning with Git//TODO:

- Git installation

- Github account setup

Page 4: Code versioning with git

Code Versioning with Git// TODO:

- creating a repository on github

- setting up a project to use git

- online or offline repository?

Page 6: Code versioning with git

Code Versioning with Git

Git-ing a project- using clone command

sam@sam-pc:~/workspace/devfest/

$ git clone https://github.com/devfest/project.git

Page 7: Code versioning with git

Code Versioning with GitGit-ing a project

- changing directories

sam@sam-pc:~/workspace/devfest/

$ cd project

Page 8: Code versioning with git

Code Versioning with Git-creating a branch in git

sam@sam-pc:~/workspace/devfest/project(master)

$ git checkout -b workBranch

Page 9: Code versioning with git

Code Versioning with Git - Adding a new file to the project- Create a new file named index.php and type the following

<?phpecho “Hello PHP!”?>

Page 10: Code versioning with git

Code Versioning with Git - using the git add command

sam@sam-pc:~/workspace/devfest/project(workBranch)

$ git add -A

Page 11: Code versioning with git

Code Versioning with Git- using the git commit command

sam@sam-pc:~/workspace/devfest/project(workBranch)

$ git commit -a -m”Commit message”

Page 12: Code versioning with git

Code Versioning with Git- Using the git push command

sam@sam-pc:~/workspace/devfest/project(master)

$ git push origin master

Page 13: Code versioning with git

Code Versioning with Git - git-ing an existing project

sam@sam-pc:~/workspace/devfest/project

$ git init

Page 14: Code versioning with git

Code Versioning with Git - adding a remote repository origin

sam@sam-pc:~/workspace/devfest/project(master)

$ git remote add origin https://github.com/devfest/project.git

Page 15: Code versioning with git

Code Versioning with Git - pushing codes to a remote repository

sam@sam-pc:~/workspace/devfest/project(master)

$ git push origin master

$ git pull origin master