I'm building an application in Ruby on Rails 4 to handle git repositories, kind of like GitHub. One of the features is an in-app text editor with the option to commit your current changes. This is the part where I'm stuck. I need to use Rails to somehow get the changes, commit them, then push them to the remote.
The only thing I've thought of is using a Bash script to do this. The script would just be:
git add -A
git commit -m "Message that I get from user"
git push origin branch_name
The message and branch name would be variables that I get from the user.
For some reason, I don't think this would actually work.
Is it possible to use a Bash script to commit and push a Git repository with Rails? Is there a better, working method to do this?