Using Git

So, the things around the world are changing rapidly. We’re in the era where almost every person has a smartphone. People talk to others more online and less offline (it’s their fingers which talk, and not their tongue). This has hugely impacted the software industry. Software development and computing is shooting to the sky. More mobile phone variants, more computing platforms, more apps, and yet it still feels incomplete! Lots of competition, money spilling/grabbing and everyone wants a piece of it. It seems like the people are running faster and faster, day by day, and as they do so, the world to seems to be rotating faster to keep up the pace.

Almost every software organisation is now following Agile Software Development. When there’s agility, there’s cursing, blaming and hatred. People work in groups for building a software piece, a bunch of the guys collaborate to work on the same codebase. As they do so, one may mess up the work that the other guy in the group had done, it repeats several times and then emerges cold war (or even worse) amongst the group. This is where we make a switch to better code versioning/revisioning.

Git is a code revisioning tool/system which lets every person in a team to have their own copy of the code locally. So when changes are made to he code by one person, it doesn’t affect the others. The person can continue working on his local copy smoothly and when everyone’s code has to be put together, they all sit together, discuss and merge their code peacefully.

git init
echo "test" > hello.js
git add .
git commit -m "initial commit"
git push

Navigate to your project directory and initialize it for git:

cd /path/to/project/directory
git init

Now your project directory has been initialized, which means, you can now perform git operations on this directory.

If the project directory is empty and you haven’t added any code, you could add them first. If you already have added your project files, you can now add each of them for versioning:

 git add . 

By doing this, you’re telling git to add all the files of the directory for versioning. Git can then maintain revisions of each file.

Advertisements