Code versioning with git
Click here to load reader
-
Upload
samuel-okoroafor -
Category
Technology
-
view
238 -
download
0
description
Transcript of Code versioning with git
![Page 1: Code versioning with git](https://reader037.fdocuments.in/reader037/viewer/2022100220/554a5672b4c9054b328b4b99/html5/thumbnails/1.jpg)
Code versioning with Git(from zero to hero)
@Samuel_NEThttp://about.me/okoroaforsamuel
![Page 2: Code versioning with git](https://reader037.fdocuments.in/reader037/viewer/2022100220/554a5672b4c9054b328b4b99/html5/thumbnails/2.jpg)
Introduction- What is Git?
- Why use Git?
Code Versioning with Git
![Page 3: Code versioning with git](https://reader037.fdocuments.in/reader037/viewer/2022100220/554a5672b4c9054b328b4b99/html5/thumbnails/3.jpg)
Code Versioning with Git//TODO:
- Git installation
- Github account setup
![Page 4: Code versioning with git](https://reader037.fdocuments.in/reader037/viewer/2022100220/554a5672b4c9054b328b4b99/html5/thumbnails/4.jpg)
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](https://reader037.fdocuments.in/reader037/viewer/2022100220/554a5672b4c9054b328b4b99/html5/thumbnails/6.jpg)
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](https://reader037.fdocuments.in/reader037/viewer/2022100220/554a5672b4c9054b328b4b99/html5/thumbnails/7.jpg)
Code Versioning with GitGit-ing a project
- changing directories
sam@sam-pc:~/workspace/devfest/
$ cd project
![Page 8: Code versioning with git](https://reader037.fdocuments.in/reader037/viewer/2022100220/554a5672b4c9054b328b4b99/html5/thumbnails/8.jpg)
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](https://reader037.fdocuments.in/reader037/viewer/2022100220/554a5672b4c9054b328b4b99/html5/thumbnails/9.jpg)
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](https://reader037.fdocuments.in/reader037/viewer/2022100220/554a5672b4c9054b328b4b99/html5/thumbnails/10.jpg)
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](https://reader037.fdocuments.in/reader037/viewer/2022100220/554a5672b4c9054b328b4b99/html5/thumbnails/11.jpg)
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](https://reader037.fdocuments.in/reader037/viewer/2022100220/554a5672b4c9054b328b4b99/html5/thumbnails/12.jpg)
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](https://reader037.fdocuments.in/reader037/viewer/2022100220/554a5672b4c9054b328b4b99/html5/thumbnails/13.jpg)
Code Versioning with Git - git-ing an existing project
sam@sam-pc:~/workspace/devfest/project
$ git init
![Page 14: Code versioning with git](https://reader037.fdocuments.in/reader037/viewer/2022100220/554a5672b4c9054b328b4b99/html5/thumbnails/14.jpg)
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](https://reader037.fdocuments.in/reader037/viewer/2022100220/554a5672b4c9054b328b4b99/html5/thumbnails/15.jpg)
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
![Page 16: Code versioning with git](https://reader037.fdocuments.in/reader037/viewer/2022100220/554a5672b4c9054b328b4b99/html5/thumbnails/16.jpg)
Code Versioning with Git
The End