How to use git to commit from two different machines

I am new to git.

I have a git project. I would like someone else to be able to get the repository, make changes and check their changes back to the repository.

Before that, I would like to do this from another machine that has

What is the procedure for doing this?

Should I clone the storage on a machine?

+4
source share
2 answers

When it comes to working with GitHub, there are two policies:

1 / Forking

This is the recommended way.
Basically, your colleague:

  • clone your repo (called above) into your repo (on GitHub, called origin),
  • clone its GitHub repo (origin) on its desktop (local),
  • and do whatever he wants between his local repo and his github repo repo.

It will only be pushing towards origin because it is not allowed to move upstream (ssh based authentication will fail with your reverse repo)

Whenever he wants you to integrate some changes into your GitHub repository, he will make a “ transfer request (via his GitHub repo admin user interface), notifying you of some commits to apply.
See this Andre script for an automation process.

2 / Providing access to commit

This is a less secure route when you add its public ssh key to the list of users / keys allowed for direct access to your repository up.
See "Managing Collaborators ."

+2
source

Entries in git are always executed in the local repository clone. The idiomatic way to share changes in git is to git pull from a remote repository to " git pull " any changes.

For example, you can clone the linux repository of the Linux kernel Linus Torvalds by doing

 git clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git 

You can then make new changes regularly by doing

 git pull 

The repository is not specified here in the pull command because the default repository is used.

If you have an interesting patch for the linux kernel, you can make your repository publicly host it with gitosis or other software, then you just need to convince Torvalds of git pull from you; -)

Typically, developers also distinguish between their private and public repositories. You can use "git push" to push changes from your personal to a shared public repository.

+2
source

All Articles