introduction to git
TRANSCRIPT
GITANDROID STUDIO WITH BITBUCKET
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.
Why Git?
Branching and Merging
Small and Fast
Distributed
Data Assurance
Staging Area
Free and Open Source
Branching and Merging
multiple local branches
Frictionless Context Switching
Role-Based Codelines
Disposable Experimentation
Why Git?
Branching and Merging
Small and Fast
Distributed
Data Assurance
Staging Area
Free and Open Source
Small and Fast
Nearly all operations are performed locally
Git is written in C
Why Git?
Branching and Merging
Small and Fast
Distributed
Data Assurance
Staging Area
Free and Open Source
Distributed
No “checkout” but “Clone”
Multiple Backups
Multiple Workflows
Subversion-Style Workflow
Integration Manager Workflow
Dictator and Lieutenants Workflow
Why Git?
Branching and Merging
Small and Fast
Distributed
Data Assurance
Staging Area
Free and Open Source
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”
Installing GIT with android studio
Download Git from http://git-scm.com/downloads
Install git and And then
File > Settings > Version Control > Git
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
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
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]“
The lifecycle of the status of your files.
Checking the Status of Your Files
$ git status
Gitignore File
Contains all ignored files
To Ignore files
First line tells Git to ignore any
files ending in “.o” or “.a”
Commit Your Files
git commit
Git commit –m “intial commit”
Removing Files
Moving Files
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
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
Pushing to Your Remotes
$ git push origin master
git push [remote-name] [branch-name]
Branching and Mergeing
http://git-scm.com/book/en/v2/Git-Branching-Basic-Branching-and-Merging
BitBucket vs Github
Open-source projects
Public and private Projects
Switch between the two
Pricing
Demo
Questions
Ahmed Fathallah Junior android developer
linkedin.com/in/ahmedfathallah/[email protected]