开发者

Collaborate using Git without Remote Server

I am working on a school project with another two friends. I want an easy way for us to manage source control and I tried out Git. While Git looks great (with version control and stuff). How do I share it with my teammates? I have seen articles about sharing on a remote server? However, can I just set up Git on my computer and they pull from me? Or can I use servic开发者_JS百科e like dropbox to share projects? I hope my question is clear. Thanks


Or use an instant git daemon like so: on the 'server' (your workstation)

git daemon --export-all /home/myname/myrepo

on the receiving end (someone else's workstation)

git clone git://host-or-ip/home/myname/myrepo /home/othername/cloned

Git-daemon is a really simple TCP git daemon that normally listens on port "DEFAULT_GIT_PORT" aka 9418. It waits for a connection asking for a service, and will serve that service if it is enabled.

It verifies that the directory has the magic file "git-daemon-export-ok", and it will refuse to export any git directory that hasn’t explicitly been marked for export this way (unless the --export-all parameter is specified). If you pass some directory paths as git daemon arguments, you can further restrict the offers to a whitelist comprising of those.

By default, only upload-pack service is enabled, which serves git fetch-pack and git ls-remote clients, which are invoked from git fetch, git pull, and git clone.


You should look at github if you don't mind people seeing your code (you can actually pay for private repo though), you can set up a repository for free, it's an excellent site and resources are plently.

If you prefer to be completely private and don't want to pay look at gitosis.

But i would use github it's great


Note that a public account is not necessary. You can share between two computers using SSH, just as you would with a provider like Github. Here is one possible workflow:

  • http://www.mikedoel.com/blog/two-machine-workflow-with-git

There are many others easily found by your favorite search engine.


If you don't mind things being public Github is an excellent place to start.


Sign up for a free account at Github

We use it at work for 30 different projects across many developers, and I also use a personal account to share code with friends. Works great!


All the other suggestions (GitHub, ssh to a workstation, git: protocol) are good.

It is also possible to share using a USB drive. Create a bare repository on that drive and hand it back and forth. Fetch, merge, and push when you have the drive. It's no problem if the drive is lost, since the repository is backed up on all workstations. Obviously this depends on the team being at least occasionally colocated.

I don't know whether dropbox or another file hosting service would work.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜