0

I am importing a bigger git repository (120GB) and need to perform certain operations on this by using a script. The repository is now checked in on the GitLab server.

Due to dispace and avoiding unncessary copies, can I modify the git repository directly on the GitLab server, e.g. via SSH? I am at the moment the only user. I just want to avoid, I bypass any internal caching of GitLab they might have done on top.

P.S. Don't worry, the GitLab server it's not a production system yet ;-)

ChrisGPT was on strike
  • 127,765
  • 105
  • 273
  • 257
Daniel Stephens
  • 2,371
  • 8
  • 34
  • 86
  • Aside: Why do you have a 500GB repository? That's pretty big, and there may be a better way to work with this code. – ChrisGPT was on strike Feb 01 '20 at 14:30
  • Oh, good catch. I come from Perforce. I converted our Perforce repository (500GB) to Git (120GB) without our assets. The number was referring to Perforce, I fixed that! – Daniel Stephens Feb 01 '20 at 14:43
  • 1
    120GB is still pretty big for Git. Does your repo contain multiple projects? Typically each project should get its own repository with Git. (Yes, some places do monorepos. Yes, Google is one of those places. That's still the wrong architecture for the vast majority of use cases.) – ChrisGPT was on strike Feb 01 '20 at 15:03
  • Indeed, it's not a small repo, but unfortunately it's a single project. So no chance at the moment to split this up – Daniel Stephens Feb 01 '20 at 15:07
  • 1
    Gotcha. Well, good luck :-). I've never worked with anything that large and there are known performance issues with large repos. See http://git.661346.n2.nabble.com/Git-performance-results-on-a-large-repository-td7250867.html, https://docs.gitlab.com/ee/ci/large_repositories/ and https://www.atlassian.com/git/tutorials/big-repositories, for example. – ChrisGPT was on strike Feb 01 '20 at 15:10
  • Oh, that link is really helpful! Thanks! I am not a Git expert, but moderately experienced, and so I am just experimenting with Git and if it works for our project – Daniel Stephens Feb 01 '20 at 15:13
  • 1
    FYI, I added two more links to that comment as edits. – ChrisGPT was on strike Feb 01 '20 at 15:13
  • 1
    See also https://github.com/Microsoft/VFSForGit and – ChrisGPT was on strike Feb 01 '20 at 15:19
  • 1
    Just know that if you do this, the web interface and API likely won't update with any information because it won't be notified of any data that's added. – bk2204 Feb 01 '20 at 16:45

2 Answers2

2

New answer

GitLab almost certainly uses bare repositories on the server. If you want to modify the contents of your repository directly on your server you can try cloning a copy to the local filesystem and working on it there.

Note that your repo is quite large and there are known performance issues on large repos. See


Original answer follows.

GitLab includes a basic online IDE.

I encourage you to read that whole page, but you can get started by clicking on the Web IDE button that's displayed when you're looking at a file or a folder. Editing and committing is fairly intuitive.

Having said that, for anything beyond fixing typos I still recommend cloning the repository to a development machine and working there. A proper IDE gives more features, lets you run your tests before committing, and lets you commit multiple changed files at once as a logical, atomic commit.

ChrisGPT was on strike
  • 127,765
  • 105
  • 273
  • 257
  • Thank you for your answer! Unfortunately my question was misleading. I know about the IDE, but I was looking for a way to directly manipulate the repository on the server (via SSH) since my script has to modify a few thousand commits. – Daniel Stephens Feb 01 '20 at 14:45
  • @DanielStephens, thanks for clarifying. I've updated your question accordingly. I don't have a GitLab server handy to check, but the vast majority of Git servers use bare repositories (essentially just the contents of the repo's `.git/` directory) so there isn't a working copy of the files it contains. I guess you could [create a clone on the server's filesystem and work there](https://stackoverflow.com/a/21045596/354577), but that would use up a bunch of extra disk space. Can you add more detail about what your script does? – ChrisGPT was on strike Feb 01 '20 at 15:08
  • Thank you very much!! As mentioned, I am converting a Perforce depot to a git repo. And that takes really a long time. So I converted and commited 50% of the converted repo so far. And I thought why not continuing converting it right on the server. It saves an indirection and disk space. We talk about days of conversions here :-( – Daniel Stephens Feb 01 '20 at 15:10
  • I think the links and feedback answers my questions! Thanks again! – Daniel Stephens Feb 01 '20 at 15:14
  • Glad to help. I've updated my answer to incorporate updates from our conversation. – ChrisGPT was on strike Feb 01 '20 at 15:25
0

Yes, you can edit all of the files in your git repository using your GitLab web GUI. In your web GUI, login as root (administrator) and then select your repository, then GitLab GUI will look something like GitHub pages for a repository. You can browse through folders and files and by selecting a file, the contents of the file will be shown and in the upper pane, you can enable edit and edit the file on the server.

I think you needed a SSH solution, but from what I've found out, unfortunately there is no way to edit the repository files on a Gitlab server via SSH. In this case, the best solution is to checkout a local copy of your Gitlab server repository on the server itself and do your changes and commit to master.

aLuViAn
  • 312
  • 3
  • 16