GIT – KICK OFF AND USEFUL WORKFLOW


In this tutorial, you will see how to start and follow up a project published on a git repository.

First of all, if you don’t have git installed on your local system, install it with


Then, we are going to assume that we have a project called “Offset101”.

We have two different ways to start working on:

Fork the project

  • Let’s go to your project github repository, and make a fork to your own repo.
  • Create a new directory where you will alocate your local project copy and do the following process:

    Note: <origin> and <remoteOwner> are aliases to corresponding repositories.
  • <optional> You can check previous configuration with

    And,  you can change them manually on .git/config file.
  • Let’s get the code from the remote repo.

    Note: <master> is the branch that you want to download in order to work on. In some projects its pretty common to use another branch such as develop.
  • Once you have the project on your local environment, lets perform the following steps:
  • Now you can make whatever you need, and start working on the code itself. After that, you will need to push those changes to the repository:
  • After pushing your changes, you will need to go to GitHub, and create a pull request in order to notify the project owner that your changer are ready, and he can merge them to the main branch (in this case, develop).
  • Whenever it’s merged, you will be able to pull those changes and get the lastest version.

 

Clone the project

If you are the owner of the project, or even if you have the access rights, you may not need to fork the repository. So, another way to work on, is cloning the repo as follows: