Link to home
Start Free TrialLog in
Avatar of phoffric
phoffric

asked on

How to have a Common Git Repo that is not Shared on Remote Windows 10 laptops.

Using Windows 10 Pro. I am not allowed to download any 3rd party apps.

I am teleworking now with two others and we will be sharing our source code. I installed Git on my business laptop to help me keep track of my changes. We are allowed to transfer files to each other through a single project designated mechanism and no other way.

I originally thought that the three of us could have access to a global private Git repository, like GitLab, Bitbucket, etc. But I was told that this is not permitted. So we'll be exchanging source code without a common shared repo at the moment. I don't expect a huge amount of source code; but rather a bunch of branches with incremental changes.

I would like to figure out a way to still have a semblance of CM amongst us. Maybe a work-around is that one of the laptops is declared to hold a "primary" Git repo. And then the owner of that laptop would be responsible for updating the repo with changes and branches by getting the source code and instructions from the other two. (Or maybe the daily .git files could be sent to each other?) And we hope/trust that the primary Git repo is in good hands. My own experience with CM is that things can get messed up pretty with good developers even when the repo is shared. Without the direct sharing, I wonder if I should even try to suggest having a common, unshared repo.

Just thought if anyone else has been in a similar situation without a good shared CM repo and maybe has come up with a decent workaround.

FYI - We plan on teleconferencing with voice and desktop sharing using Skype for Business (to be replaced by Teams in the next 12 months). I am unable to share my Microsoft Office 365 with two coworkers since they are in different companies and their IT department doesn't allow outsiders with the exception of Skype for Business. I'll be pushing for unit tests to try to keep some semblance of good CM'ing.
Avatar of Sean Bravener
Sean Bravener

the only way I can think of is to do some sort of version control by printing your code into something like notepad and saving the text version off with file names reflecting the version
without access to true version control I hate to say it your project is likely doomed if it has any complexity to it.  
that being said your best bet is to try and appeal to your management to allow some sort of CM.

ASKER CERTIFIED SOLUTION
Avatar of pepr
pepr

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of phoffric

ASKER

Thanks all.

>> to try and appeal to your management to allow some sort of CM.
Appealing to them won't help because they are simply abiding by a higher authority. Maybe I'll find out who that is, and talk to them for their solution, if any.

>> git bundles
The documentation describes our situation. I think I will experiment at home. I could do this on two computers, or maybe I could just create two local repos and pretend they are not connected.
To add for the "private global Git repository". I quite understand that you are not allowed to use GitHub (owned by Microsoft) or whatever third party alternative. On the other hand, you can easily have your really company-private repository that is located at some server owned by your company. If you do not want to restrict the users in some special way, the shared disk space (file system, some dedicated directory) is enough to have a shared Git repository. If that would be acceptable, you want to create "bare repository" there, and use it as the remote repository. The bare repository allows to push changes there.
>> Can you share any disk space through the LAN (VPN)?
No.

>> Are you allowed to send files through mail or using some other tool?
Yes. "We are allowed to transfer files to each other through a single project designated mechanism and no other way."

I downloaded Python 3.7 and Pycharm. Looks like to use your script, I need to get "git describe" to work. (I am using git bash on Windows 10.)
$ git describe
fatal: No names found, cannot describe anything.

Open in new window

Never heard of git describe before.
Three users, named P, C, V, are separated living far apart. We can send large files to each other somehow (haven't learned how yet - maybe something like dropbox is my guess). PCV have Skype for Business so they can share one desktop at a time, and can talk to each other.

Scenario:
On Monday night, all three local gits for PCV are identical.

On Tuesday, P works on his own branch, so no conflicts with CV. On Tuesday, C and V work on the same branch, so potential conflicts exist.

On Wednesday morning, PCV try to get their three local gits sync'd up.

How to do that? Should one person do the syncing on their local .git, and zip the .git and send it back to the other two? (Only problem with this, is that no doubt, one or two of us will work past normal working hours and our gits will keep on gitting.

<<EDIT>>
Just read "Git Bundles – A Beginner’s Guide" which says:
"Don’t cross the streams! Before starting the project, decide what each team will name the branches on their Git repos, and make sure that the two teams are ALWAYS USING SEPARATE BRANCHES. Same-named branches will cause chaos."
http://www.wastedpotential.com/git-bundles-a-beginners-guide/
just saw this.
>> you can easily have your really company-private repository that is located at some server owned by your company, and no  allowed way to set up a shared repo.

There is a company private Repository on the server in my lab. But they said I cannot have access to it since I am now outside of the company since they sent me home to telework on a moments notice. Maybe if this were a planned event, the company might have come up with a solution. But when I requested this, they simply said no access.
I learned about tags a little, and an annotated tag is all I needed so that git describe did not have that fatal error (Bug!). In my repo, I put an annotated tag while in a branch (call it B). B is off the master at some node.

I created a test git repo in another folder (call it T) on my same laptop (in the same account). T has only the master, since only I added some branches in the other repo; and now I would like to add one of those branches (marked with the tag) to the test repo.  To simulate real life, I edited one file in the test repo to have a later timestamp than my branch B. However, this may complicate things based on what I read and mentioned in a previous post. So, I can undo this. By rights, I should have made a branch in the test repo.

In this little test, I would like to add branch B to my test git T.

Could you tell me the bash commands for B to create a bundle having only the B branch and excluding the other sibling branches; and the corresponding bash commands to get the B branch to be added branch ias a B brach n the test repo.

But then in real scenarios, we have to merge on all three repos, and given human errors, I am concerned that the three local gits may not be identical.

Note:
In git bash terminal xterm, I did a which python, and found it. And then I did python, and there was no prompt, and CTRL/C and CTRL/Z and quit() did not exit, so I just hit the x to force the screen to exit. But, that problem can be set aside for another day, I suppose.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I have some experience with Git using Bitbucket last year. I found your explanation very informative in the analogous ways to think about the DAG nodes. Thank you. Today I was very busy trying to find ways not to do what this question is about. It looks like within 4-5 months, I may have a shared Git server.

But thank you so much for this detailed answer. I was happy to learn about gitk which shows the graph fairly nicely. (Although I saw a blurb about VS Code extension which seemed to have a clearer image.) I knew about Git_Gui since that was mentioned when I downloaded Git, but happy to work with gitk.I confirmed that I can do a git difftool on two GUID's to bring up WinMerge for side-by-side differences- great! (I can't do it directly from gitk, which be nice; and I even followed instructions for git diff, but that didn't bring up WinMerge. No Problem. I will create abbreviations to do everything.)

One former co-worker who has a central shared server at work and is able to have his team work at home recommended that one of us act as the central server, and it would receive the bundles,and after the merge (or rebase,which I just learned about yesterday) then zip up the git directory and send it back via our cloud.I was wondering what is the difference between zipping up the git folder tree vs the following bundle:

git bundle create outsourcepro_DDMMYY.bundle –all
http://www.wastedpotential.com/git-bundles-a-beginners-guide/

Thanks again, pepr.
Great explanations. Crystal clear. Thanks again. I hear that Git works great until it doesn't. And with this fake shared server, it may be worse. I am thinking that with the three of us, we can have triple redundancy, and when one of us gets out of sync, we can vote on which two are correct.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks again, pepr.

Just one last question about bundles.

git bundle create outsourcepro_DDMMYY.bundle –all

Open in new window

http://www.wastedpotential.com/git-bundles-a-beginners-guide/

The link says, "pulls ALL commits from ALL branches to their local repository." This sounds like the above git bundle is creating a single bundle file that includes the entire repo. Am I understanding this right? If so, then what is the difference functionally or structurally between this bundle and zipping up the git tree folder?
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I'll take a look at your references this weekend. Thank you. I never heard of bundles before (but that is not surprising). Now I have bookmarked git cherry picking to help with the transfers.

Thanks again!

FYI - It is now encouraged to cite alternative sources. :) things keep changing. In fact, the more the merrier. Has to do with Google algorithm changes some years ago.
Just wanted to thank you again pepr for pointing me to bundles. When I added a tag to the branch, then it was easy to bundle just that branch and pull it in on the other user's local repo. (But he had to know the name of the branch to get it just right.) I wrote up the report and will be getting feedback to see whether I am the only one who knows how to simulate a remote repo using branches.

The lead was non-too happy about this because he thought it could be dangerous. But I said that with three of us, we have a triple redundant system, so if someone gets into a bad state, the other two can try to help, and if too confusing, then we can get him the branch(es) that he needs or the entire repo, and then he only lost a little. I'll recommend a local backup several times a day to another directory. And maybe we can find scripts to automatically do these incremental saves. Nothing too sophisticated. I know it's out there in the great void.

This will give the supervisor a major incentive to get me the shared repo I've been asking for if he is very concerned about the dangerous situation.

Thanks again. Was lots of fun making lots of mistakes simulating three persons on my local drive.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
At the moment due to the proprietary code, I can only backup to other areas of my SSD drive. We are still trying to work that out as new emails are arriving about setting up collaboration networks. I submitted my work about  using bundles and tags to my  supervisors and we are finalizing a workflow. There was some push back as it seemed complicated, but I gave two examples of how we were unable to reproduce two different demos that occurred before I got there.

I perused your backup plan and I can try it on my personal  computer. Looks interesting. I have access to other PCs from that computer if I can just figure out how to get past the Windows 10 firewalls.

I don't know what a bare repository is but I see there is ample explanations online. I will add that as Git thing to learn.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial