How to install and use git

Post on 15-Apr-2017

278 views 1 download

Transcript of How to install and use git

How to install and use git

Download GIT

https://git-scm.com/download/win

Download installation file from the above link

Installing GIT

Installing GIT

Installing GIT

Installing GIT

Installing GIT

Register to github.com

• Open an account in https://github.com/

Generating ssh key • Open GIT bash terminal .• Go to root directory by typing

cd~• Type ssh-keygen.exe –t rsa –C

“mygit@gmail.com“ (email that you have used when you register to github.com )• Press “Enter” whenever they ask

for passphrase

Generating ssh key • Open GIT bash terminal .• Go to root directory by typing

cd~• Type ssh-keygen.exe –t rsa –C

“mygit@gmail.com“ (email that you have used when you register to github.com )• Press “Enter” whenever they ask

for passphrase

Registering your ssh key to github

• Go to Settings from your github account

Registering your ssh key to github

• Go to SSH keys tab

Registering your ssh key to github

• Press Add SSH key

Registering your ssh key to github

• Open C:\Users\user\.ssh in your file explorer • Open id_rsa.pub file in

notepad• Copy the text and paste it to

the key field in github.com

Registering your ssh key to github

• Open C:\Users\user\.ssh in your file explorer• Open id_rsa.pub file in

notepad• Copy the text and paste it

to the key field in github.com• Press Add key

Creating a repository

• Create new repository in github.com

Creating a repository

• Create new repository in github.com

Config and use

• Open Git bash terminal in the corresponding folder

Config and use• git config --global

user.name “yourusername“• git config --global

user.email “youremail@email.com"

Config and useType the following commands in the terminal

git init

git add –A

git commit -m "first commit“

git remote add origin git@github.com:faysalhossain2007/my-first-git-project.git

git push -u origin master

Teamwork• Give permission to your

partner in your repository so that he can update the project by pushing the latest code.• To give this permission go to

settings of your repository• Then go to Collaborators tab• Type the email or username

whom you want to give the access

Teamwork• Give permission to your

partner in your repository so that he can update the project by pushing the latest code.• To give this permission go to

settings of your repository• Then go to Collaborators tab• Type the email or username

whom you want to give the access

Teamwork• Give permission to your

partner in your repository so that he can update the project by pushing the latest code.• To give this permission go to

settings of your repository• Then go to Collaborators tab• Type the email or username

whom you want to give the access

Teamwork• When ever you do some change in your file under the project

directory then first add it by typing : git add –A in the terminal • Then give the commit a name to identify your work by typing : git

commit –m “your message”• Push it to the github by typing : git push origin master• Your partner can have the latest updates of the project by pulling the

updated code. To do this he needs to give the following command in the terminal : git pull origin master

That’s it