Managing Windows Desktop Using Git

My desktop quickly becomes unwieldy, so to tame the clutter, I have been using git to take regular backup of the desktop, here’s the batch script that I have configured with schtasks on my windows system.

Posting it here with explanation so its useful for others.

@echo off
cd C:\Users\sukhbinder\Desktop

git diff --stat > test
git status >> test
git add -A
git commit -F test

Explanation

git diff –stat Gives a compact statistics on the git

git status shows the current state for the working git folder

git add -A adds all files in the folder. By all I mean all tracked and untracked files in the folder

git commit -F test commits the added files using the contents of test file as the commit message

2 thoughts on “Managing Windows Desktop Using Git

  1. Pingback: Backing up Files using OneDrive | SukhbinderSingh.com

  2. Pingback: Fix Bloated Git Repo With these Commands | SukhbinderSingh.com

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s