Posts Tagged cli
Removing a git alias
Posted by Erik Bauffman in default on June 30, 2011
I had an issue trying to remove a git alias I made. You can remove it by deleting that line from the configuration file, but I wanted to know how to do it using the git config command.
git config --global --unset alias.myAlias
When did I introduce a certain string?
Posted by Erik Bauffman in default on June 29, 2011
Today I needed to know when the string ‘2.1.0‘ was introduced in my git repository. There’s a nifty way in git log you can use for this.
git log -S ’2.1.0′
Tar changed files between 2 commits
Posted by Erik Bauffman in default on June 29, 2011
Replace [hash] with the hash of the commit. This defaults to all the changed files between the hash and HEAD.
tar zcvf “$(date +’%Y-%m-%d-%H-%M-%S’)-xmple.tgz” $(git diff –name-only [hash])
You can also update the commit range by using two hashes separated with 2 dots.
tar zcvf “$(date +’%Y-%m-%d-%H-%M’)-xmple.tgz” $(git diff –name-only [hash]..[hash2])
MySQL command line import
Posted by Erik Bauffman in default on May 24, 2011
I always seem to forget the right command.
mysql -uroot -proot databaseName < /location/to/my/file.sql