We’ve all been there. Whether it was due to a lack of caffeine or hunger pangs before lunch, a bug managed to sneak its way into the repository, and now it needs to be eradicated.
Rolling back changes with revert
Pick out individual commits
Occasionally, you may find yourself needing to extract just one commit from a branch or pluck a specific file from a changeset.
Get a file from a specific revision
Get a file from a specific revision
Bash git status
We all know the usefulness of the git status command, but typing it repeatedly can be cumbersome. Why waste time typing ten characters when you could have your shell display Git’s working state automatically?
Temporarily ignoring files
Ignoring files with Git is typically straightforward. However, there are times when you may need to temporarily hide changes in a file, such as during a development session.
List remote branches
Occasionally, you might need to identify the branches available on a remote repository to pull them down, inspect them, or merge them into your local branches.
Easily fetching upstream changes
Here’s a helpful tip from Dav Glass, who frequently pulls in commits for his work on YUI at GitHub. To streamline the process
Reflog, your safety net
Reflog is like a safety net in Git, allowing you to recover lost work and navigate through changes made to your repository.
Helpful command aliases
A convenient way to streamline your Git workflow is by creating aliases for frequently used commands in your .gitconfig file.
Intro to rebase
Git’s rebase command can be puzzling for newcomers, and its description in the manpage doesn’t offer much clarity