avatar

Andres Jaimes

Common git commands

Imagine you’re working on a project that’s stored in a remote Git repository. Your first step is to clone the repository using the command git clone git@github.com:some-account/some-project.git.

Once you’ve cloned the repository, …

Generate a random string using the console

Generate a random string using the command line:

1cat /dev/urandom | tr -cd [:graph:] | head -c 32

On OSX, the previous command might return a tr: Illegal byte sequence error, so try:

1export LC_ALL=C; cat /dev/urandom | tr -cd [:graph:] | head -c 32 …

Undoing the Last Git Commit

A command so important, it deserves its own page:

1git reset --soft HEAD~1

The previous command undoes the last commit to git. I think this is one of those commands that I have typed many times during the last year. It’s very important to know …