Home Track every single change in folder with git
Post
Cancel

Track every single change in folder with git

During my last work with Vagrant I need to track every single file change. The easiest way which I found was to create simple git repository in selected folder (with git init of course) and two new functions in PowerShell profile (to edit profile just run notepad $PROFILE):

1
2
3
4
5
6
7
8
9
10
11
12
13
14
function buildGitMsg(){
	$date = Get-Date
	return $date.ToString("yyyy-MM-dd HH:mm:ss");
	
}
function vagrant(){
	$msg = buildGitMsg;
	$gitRoot=(git rev-parse --show-toplevel).Replace("/","\")
	pushd $gitRoot
	git add .
	git commit -m "$msg"
	popd
	vagrant.exe $args
}

This small change allows me to automatically commit on every run vagrant with arguments.

Small, easy and cool :)

This post is licensed under CC BY 4.0 by the author.