Download - Introduction to git
![Page 1: Introduction to git](https://reader034.vdocuments.us/reader034/viewer/2022042717/55d175c6bb61ebd84e8b478e/html5/thumbnails/1.jpg)
GITANDROID STUDIO WITH BITBUCKET
![Page 2: Introduction to git](https://reader034.vdocuments.us/reader034/viewer/2022042717/55d175c6bb61ebd84e8b478e/html5/thumbnails/2.jpg)
What is GIT?
Git is a free and open source distributed version control system designed to handle everything from small to very large projects with speed and efficiency.
![Page 3: Introduction to git](https://reader034.vdocuments.us/reader034/viewer/2022042717/55d175c6bb61ebd84e8b478e/html5/thumbnails/3.jpg)
Why Git?
Branching and Merging
Small and Fast
Distributed
Data Assurance
Staging Area
Free and Open Source
![Page 4: Introduction to git](https://reader034.vdocuments.us/reader034/viewer/2022042717/55d175c6bb61ebd84e8b478e/html5/thumbnails/4.jpg)
Branching and Merging
multiple local branches
Frictionless Context Switching
Role-Based Codelines
Disposable Experimentation
![Page 5: Introduction to git](https://reader034.vdocuments.us/reader034/viewer/2022042717/55d175c6bb61ebd84e8b478e/html5/thumbnails/5.jpg)
Why Git?
Branching and Merging
Small and Fast
Distributed
Data Assurance
Staging Area
Free and Open Source
![Page 6: Introduction to git](https://reader034.vdocuments.us/reader034/viewer/2022042717/55d175c6bb61ebd84e8b478e/html5/thumbnails/6.jpg)
Small and Fast
Nearly all operations are performed locally
Git is written in C
![Page 7: Introduction to git](https://reader034.vdocuments.us/reader034/viewer/2022042717/55d175c6bb61ebd84e8b478e/html5/thumbnails/7.jpg)
Why Git?
Branching and Merging
Small and Fast
Distributed
Data Assurance
Staging Area
Free and Open Source
![Page 8: Introduction to git](https://reader034.vdocuments.us/reader034/viewer/2022042717/55d175c6bb61ebd84e8b478e/html5/thumbnails/8.jpg)
Distributed
No “checkout” but “Clone”
Multiple Backups
Multiple Workflows
![Page 9: Introduction to git](https://reader034.vdocuments.us/reader034/viewer/2022042717/55d175c6bb61ebd84e8b478e/html5/thumbnails/9.jpg)
Subversion-Style Workflow
![Page 10: Introduction to git](https://reader034.vdocuments.us/reader034/viewer/2022042717/55d175c6bb61ebd84e8b478e/html5/thumbnails/10.jpg)
Integration Manager Workflow
![Page 11: Introduction to git](https://reader034.vdocuments.us/reader034/viewer/2022042717/55d175c6bb61ebd84e8b478e/html5/thumbnails/11.jpg)
Dictator and Lieutenants Workflow
![Page 12: Introduction to git](https://reader034.vdocuments.us/reader034/viewer/2022042717/55d175c6bb61ebd84e8b478e/html5/thumbnails/12.jpg)
Why Git?
Branching and Merging
Small and Fast
Distributed
Data Assurance
Staging Area
Free and Open Source
![Page 13: Introduction to git](https://reader034.vdocuments.us/reader034/viewer/2022042717/55d175c6bb61ebd84e8b478e/html5/thumbnails/13.jpg)
Staging Area
intermediate area where commits can be formatted and reviewed before completing the commit.
Now you can just stage the change you need for the current commit and stage the other change for the next commit.
to ignore this feature if you don't want that kind of control — just add a '-a' “git commit–a”
![Page 14: Introduction to git](https://reader034.vdocuments.us/reader034/viewer/2022042717/55d175c6bb61ebd84e8b478e/html5/thumbnails/14.jpg)
Installing GIT with android studio
Download Git from http://git-scm.com/downloads
Install git and And then
File > Settings > Version Control > Git
![Page 15: Introduction to git](https://reader034.vdocuments.us/reader034/viewer/2022042717/55d175c6bb61ebd84e8b478e/html5/thumbnails/15.jpg)
Installing GIT with android studio
VCS > Enable Version Control Integration > select "Git“
All files colors turned red
Select <project/file> > VCS > Git > Add to VCS
All files colors turned green
Select <project/file> > Commit
To work on android studio terminal put C:\Program Files (x86)\Git\cmd into environment variables
![Page 16: Introduction to git](https://reader034.vdocuments.us/reader034/viewer/2022042717/55d175c6bb61ebd84e8b478e/html5/thumbnails/16.jpg)
Getting Started
First put
Your Identity $ git config --global user.name “fathallah"
$ git config --global user.email [email protected]
--global means that this user name will be used for all projects
$ git config –list for check your settings
$ git help to
![Page 17: Introduction to git](https://reader034.vdocuments.us/reader034/viewer/2022042717/55d175c6bb61ebd84e8b478e/html5/thumbnails/17.jpg)
Getting Started
Getting a Git Repository
$ git init to Initializing a Repository in an Existing Directory
Add New Files and commit
“$ git add *.c”
“$ git commit -m 'initial project version‘”
Cloning an Existing Repository “ git clone [url]”
For cloning in specific folder “ git clone [url] [folder name]“
![Page 18: Introduction to git](https://reader034.vdocuments.us/reader034/viewer/2022042717/55d175c6bb61ebd84e8b478e/html5/thumbnails/18.jpg)
The lifecycle of the status of your files.
![Page 19: Introduction to git](https://reader034.vdocuments.us/reader034/viewer/2022042717/55d175c6bb61ebd84e8b478e/html5/thumbnails/19.jpg)
Checking the Status of Your Files
$ git status
![Page 20: Introduction to git](https://reader034.vdocuments.us/reader034/viewer/2022042717/55d175c6bb61ebd84e8b478e/html5/thumbnails/20.jpg)
Gitignore File
Contains all ignored files
To Ignore files
First line tells Git to ignore any
files ending in “.o” or “.a”
![Page 21: Introduction to git](https://reader034.vdocuments.us/reader034/viewer/2022042717/55d175c6bb61ebd84e8b478e/html5/thumbnails/21.jpg)
Commit Your Files
git commit
Git commit –m “intial commit”
![Page 22: Introduction to git](https://reader034.vdocuments.us/reader034/viewer/2022042717/55d175c6bb61ebd84e8b478e/html5/thumbnails/22.jpg)
Removing Files
![Page 23: Introduction to git](https://reader034.vdocuments.us/reader034/viewer/2022042717/55d175c6bb61ebd84e8b478e/html5/thumbnails/23.jpg)
Moving Files
![Page 24: Introduction to git](https://reader034.vdocuments.us/reader034/viewer/2022042717/55d175c6bb61ebd84e8b478e/html5/thumbnails/24.jpg)
Add Remote Rep
$ git remote add pb https://github.com/paulboone/ticgit
$ git remote add “shortName” “rep url”
$ git remote –v list all remote urls
![Page 25: Introduction to git](https://reader034.vdocuments.us/reader034/viewer/2022042717/55d175c6bb61ebd84e8b478e/html5/thumbnails/25.jpg)
Fetching and Pulling from Your Remotes
$ git fetch [remote-name]
get all work from repo and you have to merge it manually
$ git pull
get all work from repo and merge it
![Page 26: Introduction to git](https://reader034.vdocuments.us/reader034/viewer/2022042717/55d175c6bb61ebd84e8b478e/html5/thumbnails/26.jpg)
Pushing to Your Remotes
$ git push origin master
git push [remote-name] [branch-name]
![Page 27: Introduction to git](https://reader034.vdocuments.us/reader034/viewer/2022042717/55d175c6bb61ebd84e8b478e/html5/thumbnails/27.jpg)
Branching and Mergeing
http://git-scm.com/book/en/v2/Git-Branching-Basic-Branching-and-Merging
![Page 28: Introduction to git](https://reader034.vdocuments.us/reader034/viewer/2022042717/55d175c6bb61ebd84e8b478e/html5/thumbnails/28.jpg)
BitBucket vs Github
Open-source projects
Public and private Projects
Switch between the two
Pricing
![Page 29: Introduction to git](https://reader034.vdocuments.us/reader034/viewer/2022042717/55d175c6bb61ebd84e8b478e/html5/thumbnails/29.jpg)
Demo
![Page 30: Introduction to git](https://reader034.vdocuments.us/reader034/viewer/2022042717/55d175c6bb61ebd84e8b478e/html5/thumbnails/30.jpg)
Questions