Apply a git patch directly from GUI and commit to a branch?

Viewed 77

I currently have a patch (generated using git diff) that I want to apply to a repo. But due to certain limitations, I am unable to pull the repo locally. But I have full access of the repo via the gitlab GUI. I can create branch, generate merge request, etc. Is it possible to apply the said diff via the GUI to create a branch, assuming there is no conflict.

(I know I can edit individual files and commit it but I have multiple files and I want to apply just the diff and not risk copy and paste errors.)

1 Answers

As gitlab issue 31978 illustrates, the GitLab Web IDE (the Web Integrated Development Environment (IDE) editor streamlines the process to contribute changes to your projects, by providing an advanced editor with commit staging) lacks that feature.

That means you would need a GitLab CI/CD pipeline which would:

  • checkout your repository for you (on GitLab server)
  • apply the patch.

One possibility would be to:

  • add and commit the patch content itself to your repository (through GitLab web IDE)
  • make a pipeline which would, once the repository is checked out, apply the patch, and delete the patch file from the repository.
Related