introduction to git

31
GIT ANDROID STUDIO WITH BITBUCKET

Upload: ahmed-fathallah

Post on 17-Aug-2015

32 views

Category:

Internet


1 download

TRANSCRIPT

Page 1: Introduction to git

GITANDROID STUDIO WITH BITBUCKET

Page 2: Introduction to git

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

Why Git?

Branching and Merging

Small and Fast

Distributed

Data Assurance

Staging Area

Free and Open Source

Page 4: Introduction to git

Branching and Merging

multiple local branches

Frictionless Context Switching

Role-Based Codelines

Disposable Experimentation

Page 5: Introduction to git

Why Git?

Branching and Merging

Small and Fast

Distributed

Data Assurance

Staging Area

Free and Open Source

Page 6: Introduction to git

Small and Fast

Nearly all operations are performed locally

Git is written in C

Page 7: Introduction to git

Why Git?

Branching and Merging

Small and Fast

Distributed

Data Assurance

Staging Area

Free and Open Source

Page 8: Introduction to git

Distributed

No “checkout” but “Clone”

Multiple Backups

Multiple Workflows

Page 9: Introduction to git

Subversion-Style Workflow

Page 10: Introduction to git

Integration Manager Workflow

Page 11: Introduction to git

Dictator and Lieutenants Workflow

Page 12: Introduction to git

Why Git?

Branching and Merging

Small and Fast

Distributed

Data Assurance

Staging Area

Free and Open Source

Page 13: Introduction to git

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

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

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

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

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

The lifecycle of the status of your files.

Page 19: Introduction to git

Checking the Status of Your Files

$ git status

Page 20: Introduction to git

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

Commit Your Files

git commit

Git commit –m “intial commit”

Page 22: Introduction to git

Removing Files

Page 23: Introduction to git

Moving Files

Page 24: Introduction to git

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

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

Pushing to Your Remotes

$ git push origin master

git push [remote-name] [branch-name]

Page 28: Introduction to git

BitBucket vs Github

Open-source projects

Public and private Projects

Switch between the two

Pricing

Page 29: Introduction to git

Demo

Page 30: Introduction to git

Questions

Page 31: Introduction to git

Ahmed Fathallah Junior android developer

linkedin.com/in/ahmedfathallah/[email protected]