Posts Tagged Git

Remove and ignore dreamweaver dwsync.xml files from your GIT repo

git ignore dreamweaver dwsync.xml files (and other gubbins as required)

  1. Remove any files already added form the working directory. For example:

    $ git rm -f *dwsync.xml

  2. 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.

References
hcodep://jqr.github.com/2009/02/03/global-git-ignore.html
hcodep://help.github.com/ignore-files/

,

1 Comment

Rollback a GIT commit

GIT is great, Git is good.

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>

Where  you replace the gubbins inside the angle brackets with the SHA ID of your commit. Find this easily using GitX or my potential new favourite GIT client on the Mac: Gitti.

No Comments

Using GIT to manage a website…

Nice little write-up on pushing your local GIT repo to a live web site: http://toroid.org/ams/git-website-howto

1 Comment