Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git Visual Studio 2015 Automatic commit upon successful build

I would like to automate my commits on Visual studio. However, I do not want to commit every time the files change. I want to only commit upon successful builds. So my code is always "buildable".

The main reason, I tend to forget to commit in between big changes and I always end up committing before and after adding features.

like image 671
unixsnob Avatar asked Nov 12 '15 17:11

unixsnob


People also ask

Does git automatically make commits?

Automatically detect file changes during a Workflow runIt's called git-auto-commit. Once changes are detected, those are committed and pushed back to the GitHub repo.

How do I stop a commit before pushing in Visual Studio?

To do the same in Visual Studio, right-click the commit you want to revert and then select Revert.

What is git auto commit?

Automatically commits files which have been changed during the workflow run and push changes back to remote repository.

How do I commit changes in git using Visual Studio?

Just enter your commit message and then select Commit All. The equivalent command for this action is git commit -a . Visual Studio also makes it easy to commit and sync with one click by using the Commit All and Push and Commit All and Sync shortcuts.


1 Answers

I believe that setting the following under PostBuild event on the project might work:

git commit -am "Succesful build at $(date -u +'%Y.%m.%d %H:%M:%S')"
like image 198
Ariel Rosado Rivera Avatar answered Oct 19 '22 19:10

Ariel Rosado Rivera