Version control using Git & Github

Techdobz
Analytics Vidhya
Published in
3 min readMar 22, 2020

I am a programmer, Writing a program has become a difficult task if you don’t know how to control its version, before 6th month I was developing my website at that time I have only 3-month experience in programming and am bit aware of version control that’s why I mashed up my website code lot’s of time and started from a scratch lot of time. but now I know how to control the version of your project and stay away from mistakes I have made.
So, I am writing this blog about how you can also control your project versions using git and on Linux and Windows platforms.

Let’s go,

WINDOWS

For version control on windows platform, you should download git on your pc so follow the below link and download it.

Download it for windows .

Now Git provide version control and Github provide you to upload your code online and share with other developer community.

Let’s Create a Github account.

Now you are ready to use Git and Github.

Let’s create a project folder and store all the content of your working project in that folder .

Let’s say name of project folder is my_project

Step 1 : Create a repository on your Github account.

Click on New and create new repository

Srep 2 : you will find out clone or download button click on that and copy that link it will use for further step.

Ok, Now all the work from the Github site is over.

Step 3: Open CMD and locate your project folder by cd command.

Step 4: git init

This will initialise an empty directory.

Step 5: git add .

This will add all the file which are in your project directory to local directory that will store information of which file will push to Github.

Step 6 : git commit -m “First Commit”

This command is like save command in our pc it will ensure that you are sure that you want to save all changes you have mad to push on Github

Step 7 : git remote add origin <paste link we have copied> #don’t use < > in command

This will save the info of our repository in origin veriable at which we want to push our project

Step 8 : git push -u origin master

This push your project to Github. -u is use to save info for next push.

Now you can check on Github website your project will be there.

To be continue …

--

--

Techdobz
Analytics Vidhya

I write about programming , self awareness , lessons , productivity that help me live a better life. https://techdobz.herokuapp.com