How do I create code with one github rep on two computers?

I have two computers from which I want to contribute to one github repository. How can i do this?

+48
git github
May 15 '11 at 23:55
source share
4 answers

To synchronize both repositories, you must pull the latest changes to your computer whenever you start working on the code.

For this you want to execute

git pull 

... which is usually configured to pull from the default remote (source) to the current branch. Git may complain if this is not the case, and therefore a longer version will work:

 git pull origin {branch_name} 

Note. This is the same process that you would use if two or more people were working on the same repo. Essentially, this is what happens, instead of two different people working in the same repository, you have two different machines working in the same repository.

If you are starting a new one on a new machine, all you have to do is clone the repo first:

 git clone {remote_url} 

You get this URL from your GitHub repository homepage. This command will create a full working copy of the repo in a subdirectory.

+51
May 16 '11 at 12:02 a.m.
source share

You need to clone the repository on your second computer.

 git clone git@github.com:myusername/myrepo.git 

Now you can use git pull and git push to synchronize the local repository with the GitHub file.

+2
May 16 '11 at
source share

You want to check the repository on another computer, you do not want to fork it.

0
May 15 '11 at 23:58
source share

Starting to work with another computer, do the following:

1- Create a new directory on your local computer to save your work.

2- from this newly created directory, open Bash (suppose you already have git installed on your computer) by right-clicking and you will see (Git Bash here).

3- on Bash type git clone (your Repo url or ssh key). press enter

4- just done. :)

0
May 16 '14 at 17:15
source share



All Articles