How to Clone Git repository and contribute your updates directly from your desktop?

Kumarjit Pathak
Technical help for Data Science
4 min readApr 4, 2018

This is something I have struggled myself and trust me it was annoying in the beginning. Gradually with help from my friend Ernest S Kirubakaran it was cracked.

This document would help to understand how you can clone a repository which you are working with or say contributing jointly with someone along with update your code updates or other update to the master folder of Github link.

This time, I want to keep less text explanation as the image snapshot will help you to understand how you can achieve this.

Step1: Go to the folder where you want to close the git and latter update the files:

Step2: Go to the folder and right-click and open Git Bash (if you don’t have it then please install gitbash from internet):

Step3: Once the window of gitbash opens:

Type a command to initialize git as below-

git init
This is how it may look after gitbash opens

Step4: Now link the email ID what you use for github. This is the registration email-ID for your github account.

git config user.email “emailid@gmail.com”
git config user.email

Step5: Now go to the github page where you want to update the work: Copy the link from the browser. Post which type the below command to add the link to the gitbash from which it would download / clone the repository

Go to your repository and copy the path highlighted in blue on the top

Now go to gitbash window and type the below command with the current path. ctrl +v would not work and hence you need to use mouse to right click after “git remote add origin” command and paste the link.


git remote add origin https://github.com/xxxxx/xxxxxxx
Example screenshot from my computer

Step6: Now we need to clone / pull all the files from the link , this will create a local desktop copy of all the contents. Type the below command.

git pull origin master

Step7: Now we have all the folder structure and content from github downloaded at our local desktop.

If we intend to update any file or existing notebook with modification we need to first copy paste those files in to the respective folder structure where we intend to upload the same.

Post this activity we need to add each of the file with below command:

git add folder_namexxxxx/xxxxxxxx.ipynbgit add folder_namexxx/hhhhhjjjjj.txt

Step8: Now we shall do a commit using command. When we commit any changes it is good to provide with a comment related to the changes made. this helps to track the addition or modification done.

git commit -m "put your comment for the change xxxxxxxxxxx"

Step9: Now the final step. just with one command you can upload all the changes back to github folder.

git push origin master

Now you are done. Feel free to check the github repository whether the changes are updated or not

--

--

Kumarjit Pathak
Technical help for Data Science

AI Product development leader with core data science expertise. 16+ years in the industry . Research advisory board member of AIMS institute.