Kirby Auto Git Plugin

I use(d) the latest version from git. I’ve a repository on my server, which is the remote repository for my local repository I don’t have a remote repository set up on my server, I don’t have an additional repository on github or so. So I would like to commit on my server to the repository there so that I’m able to pull it to my local repository. Currently I use the repositroy only as Backup for the content and have to log in via ssh and commit everything on the server manually and I would like to be able to do this throughout the panel and thought that this would be possible with AutoGit.

Now I understand your problem. Unfortunately there isn’t much Auto Git can do for you there.

I’d recommend that you setup an account at Gitlab or Bitbucket, they both offer free private repos. This will simplify your workflow a lot!

Although I’m not really sure I understand your setup correctly, there is an alternative plugin you might want to check out, which does not require a remote repo: https://github.com/blankogmbh/kirby-git-commit-and-push-content.

Auto Git also doesn’t require a remote repo to create commits when content changes. It only requires a remote repo if you want to use the widget or webhook to pull/push commits.

From what I understand, he has a repo on the server and a repo locally which aren’t connected by a remote repo hosted on Github (for example).

Correct, why would I add a third party and move content between three locations from a over b to c when all I want is to move it from a to c?

I’m pretty sure you can setup a Git server on your own so that you can push and pull from your local machine. Just know that this is not common.

The standard workflow is what I told you before. Using push hooks, I can easily send content from local to server and back by just clicking a button on Auto Git’s widget, pretty straight forward.

Awesome plugin. How does it handle merge conflicts?

It doesn’t as there’s nothing to merge. :slight_smile:

What if two users are editing content in the panel at the same time from different machines, and they both edit the same content and attempt to push their changes? You can’t push without pulling the latest version first, and when the second user attempts to pull, a merge conflict will occur, right?

Since the commits are done on the server, not the client, there is only one Git history. Of course it gets tricky if you use more than one server, but then there’s nothing the plugin can do to solve conflicts automatically. It’s not recommended to use more than one server anyway, otherwise you need to push and pull all the time before making changes.

I fell very dumb, I don’t know how to configure the plugin. There is some kind of dummy guide anywhere?

Thanks in advance!

What part are you getting stuck on?

Do you have Git installed? Have you worked with Git repos before?

on server you need git installed. overview of commands can be found here. then call git init (via ssh maybe). then add all uncommitted files git add -A and git commit once. rest should be handled by autogit plugin.

Thanks I will give it a try.

Thanks looks awesome!

How to get this setup with other code already in git?

I have structure like this

/ 
/.git
/dev (uncompiled sources)
/htdocs <- is webroot  (kirby, site, content etc) 

Beside origin remote i also have live remote that is my server and i deploy by pushing to the live remote. To make this work i have /htdocs/content in .gitignore (the content is only on the server). I always wanted to have content also in git but the setup is baffling for me now.

Is everyone deploying manualy and have just content in the git repo?

Should i just make special branch content and put just content there? That wont work no? Or some setup with content as git-submodule?

Hello, and thanks @pedroborges for the plugin

I am trying to understand if it works with my particular case.

We have a remote repo on Gandi. To deploy this repo to a live public website, we use a deploy command/system that belongs to Gandi.

We want the code to go: local->remote->live
But we want the content to go: live->remote->local

That’s why autogit.

But if I get it correctly, we need to init a git repo on the live location, and we need to add a remote repo to it, before we can go into autogit optoins and set that remote repo in the autogit.remote.name option. Is this correct?

Thank you.

Hi and thanks for the plugin.
I would appreciate some advice. I am currently trying to find a good deployment strategy, so that code and content can be edited simultaneously. So far I found out that working with submodules can make things easier. Therefore I created a submodule containing my content folder. I also copied the Auto Git plugin into my plugins folder. I feel like there is more I have to do in order to get it working the way I want it to. I can’t seem to find the changes commited automatically. Do I still need to install via CLI? Do I even have to add the plugin as a submodule for these purposes? Does the architecture make sense? I imagine it to work out like this:
The developer develops on the develop branch which he merges into master if he wants to deploy. The “texter” changes the content in the submodule which is auto commiting. When he’s done he pushes the changes over a button (I have read there is UI components for pushing and pulling coming with the plugin). Now that the changes got pushed the master branch has changes and needs to be pushed in order to gain an uptodate deployment, which can easily be triggered on merge. I wonder if this model works without merge conflicts and what I still need to configure in respect of the plugin?

Thanks in advance!

Just released v0.6.0 implementing some changes based on community feedback.

Added

  • autogit option: disables the plugin.

Changed

  • Git user.name and user.email local configuration are no longer replaced. Instead, the plugin now sets the author with the git commit --author flag.
  • The plugin no longer checks if the content folder is a Git repo since it required an extra command to be run. Use the autogit option to disable the plugin when needed.

Removed

  • autogit.branch option: Auto Git will always use local current branch.
1 Like