How can I have the main repository stored on a local network? - version-control

I'm wondering how can I have the main Mercurial repository stored on the local network and every developer connected to it can do the usual things (just like with BitBucket online.)
Thanks.

Check https://www.mercurial-scm.org/wiki/PublishingRepositories
If it's only on a local network, hg serve is the easiest/fastest with 0 auth support.
of course you can always use ssh without the need of setting up a server.
hg clone ssh://your-main-server/path/to/repo

Set up a machine running the apache HTTP server (or another webserver that can host hgwebdir)
Install the hgwebdir CGI script.

Related

Working with SSH connection and Github workflow

in working on an experiment on a ML technique that required me to use a better machine for computational purposes, so they gave me an SSH connection to the machine. Also the data were stored in that server.
My workflow was this:
(I'm working on a headless server)
Connect my local machine via ssh and run the script for the experiments...
On that machine I could only use vim without all my setup
If I want to change something I have to change it in my local then push the changes
I pull the changes on the remote server and then I try a new experiment.
Occasionally I had to push from the remote server the results (plots and more) and then pull them from local to work on that and push again eventually.
I think there is a flaw in this, and there's a better way to manage all of these things.
Do you have some ideas?
What i need is just a clever way to do not push every change i do.
Another alternative is to use an IDE like VSCode with the Remote - SSH extension, following this tutorial.
That way, your local VSCode, on your local machine, displays and edits directly files on the remote machine, without you having to pull/push them.
Depending on that extension, you might still need a separate SSH session in order to git add/commit those modified files.

gitlab backup restore affects url redirection

I got a production server (ip:172.24.4.10) where GitLab 8.15.3 is installed.
Then I made a GitLab backup and I transferred the file to a test server(ip:172.24.4.50).
When I'm using a browser, I go to http://www.mygitlab.com which aims to ip 172.24.4.10.
The test server has same GitLab version and I executed the restore from backup file and it worked.
Even though, when I use the browser I go to http://172.24.4.50, it redirects to http://www.mygitlab.com.
It wasn't happening before restoration on test server.
I was checking gitlab, gitlab-nginx config files and I'm not finding something related to http://www.mygitlab.com.
What can I do?
P.D.
I put http://www.mygitlab.com as example.
My PC was restarted becasuse there is a job in charged to restart PCs. After that, I used the browser going to http://172.24.4.50 and it started to work. So I think it was a cache browser issue and I didn't make any changes to gitlab config files.
If you haven't transfered/copied over your NGiNX settings, then it is a GitLab configuration issue.
Said configuration (for example in /etc/gitlab/gitlab.rb) does include:
external_url "http://gitlab.example.com"
Do check if the redirection comes from there.

Will changing the remote url to be ssh cause issues for team members not using ssh?

I'm trying to get set up with SSH. One of the steps mentioned converting any existing remotes from https to ssh and the instructions to actually do it seem clear enough https://help.github.com/en/articles/changing-a-remotes-url
I'm curious though will other team members still be able to connect via https to that remote repository? Are there any other unintended consequences that could occur?
Changing a local remote repository URL doesn't affect anyone but you.
In the case of GitHub, it's acceptable and common for one team member (e.g. a full-time employee) to have an SSH remote, and another to have an HTTPS remote. GitHub provides both.
You can use both, too. You'll just have a different experience when you push to one remote versus the other:
$ git remote -v
origin git#github.com:hashrocket/tilex.git (fetch)
origin git#github.com:hashrocket/tilex.git (push)
origin-https https://github.com/hashrocket/tilex.git (fetch)
origin-https https://github.com/hashrocket/tilex.git (push)

Simple push/pull between two "client" repositories to share changes

I'm in the process of more correctly implementing Source Control via Mercurial at work and I've run into a situation. My environment is two programmers with a Server and approx 4 dev computers. There are our 2 Office desktops where the majority of the code writting happens. And then there are 2 laptops used in the Labs for testing and debugging.
Previously, we had just been operating over the network; the code projects lived on the server and both my office and the lab laptop opened the files over the network. Yeah, I know it wasn't the best of ideas, but we made it work. Moving to a more correct model of DVCS with local repos presents with me with a problem: How do I get my code updates from my Office where I was typing to the Lab so I can program an actual chip? I feel like this level of changes (10, 20, 50, maybe even 100 little changes over the course of a day of development) doesn't need to go through the Server. Personal opinion is that commits to the Server should be reserved for when I'm actually ready to share what I have with others... not necessarily finshed with the project, just ready to share where I'm at.
Do I have to push to the Server and then pull to the Laptop everytime?
Can I just push/pull back and forth between my Office and the Lab laptop repos? How would I set that connection up?
Under the assumption that the "Server" is CVCS-emulation in DVCS environment (i.e push target|pull source for all data exchanges exclusively) and "always working single branch" antipattern not used:
Each Dev-host work with at least two named branches: personal (for WIP) and shared (merge-target) "default". WIP have to be pushed to Server, every other host Sync local repository with the whole Server's repository (but "authoritative source" is only default branch)
Pure DVCS-model
Except "Server" as default path, each Dev-host have 3 additional entries for other Dev's workplaces and pull-only model used for simplicity (no additional ACL and rules for pushes). I.e. (with human's communication) local http-server (hg serve) activated on source(s) on demand and on target developer hg pull ANOTHERDEV. Source server can' be stopped after it. Personal named branches isn't bad idea in this case also
Note: `hg serve can be always enabled on all 4 dev-hosts, combined pull command (pull 3 another repos) xan be defined as alias on every host and used when needed, without additional negotiation

Deploy with capistrano through sftp (no ssh available)

I was wondering if it is possible to deploy a rail application to an host for which I only have sftp access. (No ssh access, unfortunately).
I found this page,
http://codesnippets.joyent.com/posts/show/1271
which it makes me think it could be done, although it really is not clear with me what I should do with such file, nor whether this also enables also cap deploy:setup through sftp... Any suggestions please? Thanks!