简体   繁体   中英

working with git on a ubuntu server

I have a small network of machines (2 windows, 2 macs, 1 ubuntu server and 1 fedora). I was wondering if any once could help me with how I should set git up so I can push and pull files both locally and remotely. However I do not want to use github.

So ideally i would like to have git installed on my ubuntu server and then be able to pull and push from my other machines.

So far i have managed to install git on my ubuntu server. init a folder and add/commit files in said folder. Im not too sure on how I can get my other machines to pull and push to this server.

Any ideas would be helpful.

If you want to push, then you should use a bare repository. On the Ubuntu server, from your home directory, do:

git init --bare myrepo.git

Then on the other servers, just:

git clone username@my-ubuntu-server:myrepo.git

Then pull and push should just work. Use an IP address instead of my-ubuntu-server if you don't have DNS set up.

You can do in the way described by Robie Basak. If you want to have more fine grained control, you can install the gitolite package. See eg here for a step-by-step introduction. You might also want to review the very extensive documentation . If you also want to have bug tracking, code review, wiki and pull requests, take a look at gitlab .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM