ja laj
ja laj

Reputation: 13

Git windows server with Github

I'm fairly new to Git and was hoping someone can help me. We are working with an external provider and there code is on github which has a couple of branches (say branch1 and branch2). We plan on having a local Windows git server just using a bare repo and devs will be able to access this by just file share for now where they will clone, push, pull. Reason behind a local server is due to size.

What would be the best way to go about implementing, using this ? For example: 1. create a bare repo on our server - git init --bare 2. Add a remote to github name github 3. Fetch remote repo(from github) 4. User clones our local repo... 5. push/pull to our local... 6. how would you now merge our code into a branch on github?

Update: Sorry, one other thing i forgot to mention is that we have only been granted pull access to github which we can't change due to the third party. We only get granted push access once everything is complete

Thanks

Upvotes: 1

Views: 489

Answers (2)

VonC
VonC

Reputation: 1329222

Whenever size is an issue, don't forget that Git isn't a centralized VCS in which you can drop everything in it.

You should decompose your large set of files into several Git repo, allowing developers to clone/work only on some of those repos.

Any work on a file share should be avoided with Git: it kills performance...

Upvotes: 0

Andrew Aylett
Andrew Aylett

Reputation: 40760

You could either set up a script to push the changes up to Github as they appear in the repository, or you could task someone with deciding when it's necessary and manually pushing changes from their own clone of your repo up to Github. Remember that in a distributed environment, no particular repository has any technical reason to be different from any others: it's all convention.

One thing you should be careful of, though: using file shares, all changes in the repo on your server will be made directly by the user doing the pushing. Even over a LAN, that might well be slower than talking to an intelligent server over the internet. I've also had difficulty in the past pushing to remote Git repositories over SMB. If it's at all possible, set up a server rather than just using file shares. If that's not possible, test well and verify that you're actually getting better performance.

As stated in the comments, there's no reason to set up a synchronised mirror for people to do an initial get: remember that all the repositories will have the same data. Rather than downloading the entire history every time, there's nothing stopping someone new from grabbing all the history from their colleague next to them, then pulling and pushing to Github.

Upvotes: 1

Related Questions