Clone repository from other user but push to / pull from main server

Few users use main server with repository and clone it by:

git clone --recursive git@gitsrv:Android/sw/Android.git

It last very long (more than a day).

So I've read that I can clone directly from other user if he has already cloned repo from server by: How can I 'git clone' from another machine?

But I mustn't push into other user repo. I must push to main server. And further pulls must be also done from server not from other user. How to do that?

And by the way: where "gitsrv" is defined (it's a kind of symlink?) ?

Answers


This can be done easily by running git daemon on the user machine - assuming it is called machineA. Example - git daemon --base-path=<absolute full path to git repo>

To clone from that machine - git clone git://machineA/foo.git.

For pushing to a different machine, add in a remote server - git remote add main ssh://mainServer/foo.git and then push using git push -u main master

Remove reference to machineA by git remote remove origin. Assuming that your remote server is named origin. If you are not sure of the name you can check by running git remote -v, that will list the reference name and the URL.

If you want to keep the name origin, just set the url by running git remote set-url origin ssh://mainServer/foo.git


Need Your Help

"A duplicate insert block exists for class xx in the source files"

visual-studio evc4

In Embedded Visual Studio 4, I'm attempting to add a class though the class wizard.

Ordering a monthly and quarterly query

sql sql-server-2008 union datepart

I want to start off by giving a tremendous thanks to everyone who participates in this forum. The plethora of knowledge and examples has been an amazing resource at 3 am the day before [INSERT PRO...