Posts Tagged Git
git ignore dreamweaver dwsync.xml files (and other gubbins as required)
Remove any files already added form the working directory. For example:
$ git rm -f *dwsync.xml
set up your a global git ignore file
create a gitignore file in your home directory. eg:
$ printf "dwsync.xml\nThumbs.db\n" >> ~/.gitignore
using git config add this to you git prefs
$ git config --global core.excludesfile ~/.gitignore
For repos that may be worked on by multiple users you should also create this file at the root of your working directory.
I mostly use git to track changes (very useful to check on what I’ve been up to when it’s late in the night!) but occasionally I need to use it to roll back to a previous commit. This is the command I always forget, and today it took me more than one minute to find the answer (or formulate the right question) on google.
The answer, unsurprisingly on stackoverflow: in your [git tracked] working directory enter this terminal command:
git reset --hard <tag/branch/commit id>