How to use Git to work on the same project in a distributed team?


I have some doubts with git, well, the commands and so I know them, but I have doubts about how to organize myself. I tell you a little about my case:

I usually work with two computers, one at home and the other at work (I don't work as a programmer, but in my free time I do things). If I have a project on github, my question is how I should do to program in that project from both computers.

Let's see if you can guide me a bit about the correct way to work with git.


If I clone the repository on both computers, I would be using the "master" branch on both of them, so if, for example, one afternoon for whatever reason I don't upload the changes I made at work, then when I get home, can I continue normally?

And if in each of the computers I have a different branch, the way to do it is, a branch for each task? That is to say, on the work computer I create a branch to develop certain characteristics of the program, then at home I make another to develop on the other hand and thus, each branch for a task.


To work from two different locations, you need to clone the github repository on both computers and keep both local repositories up to date.

When you make modifications to the job for example, add the changes to the repository ( git add and corresponding git commit ). Once done, upload the changes to the remote repository on github:

git push origin RAMA

If you don't work with any branch other than the master branch, upload your changes to it.

When you get home, you just need to bring the changes that are in the remote repository (github):

git pull origin RAMA

The name of the branch must be the same, since you are specifying from which branch you want to bring the changes to your local repository.

Before adding any new modifications, it is always recommended to verify that there are no more up-to-date changes in the remote repository. For this, you can use the above command git pull .


Scroll to Top