Thursday , March 30 2017
Home / Linux / Working with git from a Linux machine

Working with git from a Linux machine

gitAfter a long struggle I managed to learn the basics of Working with git and use it effectively for the sake of code sharing and team work. I will document the steps for my own reference and to help others facing similar problems

STEP 1: Fork or create a repository. For this you will need an account in go ahead and create one. Create a repository using the ‘Create a new Repository’ icon from the top right. Give the unnecessary  description for the repository and finish the procedures that follows.

STEP 2: Install git in your computer. In ubuntu you can do it by typing,

once git is installed you will have to set the username and email in the git config files. To do this just type,

STEP 3: Clone the repository into your machine. Now open the repository you just created by clicking on its name. You should find some link to ssh and https in the center. copy the link address. From the terminal type,

This should do the clone work. If you are facing any problems just remove the ‘s’ from the https. That will do the magic (took me a long time to figure that out)

STEP 3: Add files to be committed. Now move into the directory that you just cloned into your working directory.

After that you can start using this directory as any other directory. Add as many files as you want. Then you will have to ‘add’ files to be committed (something like add to cart in a shop).

So far so good. You have successfully added files and directories into your commit stack.

STEP 4: Commit your work. You have to commit the added files with a commit message. Well its not really ‘have to to commit with a message’ you can commit without a message also but rule of a thumb is to add a name to your commit so that you will be able to identify what is being added.

we are not done yet, be patient your commit has not yet reached the github server.

STEP 5: Push it! Thats that last step. you will have to push your commit into the github’s server. You can do this by typing,

You should give your username and password when prompted.
you should see something like this,

Now if you see the repository in your github home page you will see the update. Happy gitting and good luck with open sourcing.

About Siddharth

Siddharth is a Firmware Engineer, techie, and a movie-buff. His interests include, Programming, Embedded Systems, Linux, Robotics, CV, Carpentry and a lot more. At times, you could see some of his sunday projects converge on release quality. You get to know him on the following social channels.

Check Also

Compiling C Programs Using GCC

C is the most widely used programming language for Embedded Systems. Even today most of the …

Keep in touch with the current trends!
Did you like this article? Sign up and get our latest posts delivered to your inbox!
  We hate spam and never share your details.