How to install and use git

25
How to install and use git

Transcript of How to install and use git

Page 1: How to install and  use git

How to install and use git

Page 2: How to install and  use git

Download GIT

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

Download installation file from the above link

Page 3: How to install and  use git

Installing GIT

Page 4: How to install and  use git

Installing GIT

Page 5: How to install and  use git

Installing GIT

Page 6: How to install and  use git

Installing GIT

Page 7: How to install and  use git

Installing GIT

Page 8: How to install and  use git

Register to github.com

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

Page 9: How to install and  use git

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

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

[email protected]“ (email that you have used when you register to github.com )• Press “Enter” whenever they ask

for passphrase

Page 10: How to install and  use git

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

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

[email protected]“ (email that you have used when you register to github.com )• Press “Enter” whenever they ask

for passphrase

Page 11: How to install and  use git

Registering your ssh key to github

• Go to Settings from your github account

Page 12: How to install and  use git

Registering your ssh key to github

• Go to SSH keys tab

Page 13: How to install and  use git

Registering your ssh key to github

• Press Add SSH key

Page 14: How to install and  use git

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

Page 15: How to install and  use git

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

Page 16: How to install and  use git

Creating a repository

• Create new repository in github.com

Page 17: How to install and  use git

Creating a repository

• Create new repository in github.com

Page 18: How to install and  use git

Config and use

• Open Git bash terminal in the corresponding folder

Page 19: How to install and  use git

Config and use• git config --global

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

user.email “[email protected]"

Page 20: How to install and  use git

Config and useType the following commands in the terminal

git init

git add –A

git commit -m "first commit“

git remote add origin [email protected]:faysalhossain2007/my-first-git-project.git

git push -u origin master

Page 21: How to install and  use git

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

Page 22: How to install and  use git

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

Page 23: How to install and  use git

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

Page 24: How to install and  use git

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

Page 25: How to install and  use git

That’s it