View or change the remote URL of a Git repository
Learn how to view or change the URL of the remote repository in Git.
The Git snippet collection contains a variety of short tips and tricks for all currently maintained versions of git. It includes most commonly-used commands and covers various use-cases in the form of simplified documentation, complete with multiple examples.
Learn how to view or change the URL of the remote repository in Git.
Git submodules are a powerful feature that often trips up developers. Fret not, this guide will help you understand the basics.
Learn how to quickly and easily reset your local master
branch to match the one on the remote.
Learn the simple way to undo a commit in Git without rewriting history.
Did you make a mistake but haven't pushed your changes yet? Learn how to rewind back to a specific commit in Git.
Rebase the current branch onto another branch in Git.
Learn how to push and pull changes between local and remote repositories.
If you find yourself needing to fix a previous commit, you can create a fixup commit that can be autosquashed in the next rebase.
Did you set up a lot of Git aliases and forgot what they are? List them all with this command.
Git defaults to fast-forward merging when possible. But, what if you want to disable it by default? Let's see how you can do that.
If you want your team to follow a common format for commit messages, you can set up a commit message template to make it easier.
Effortlessly create upstream branches on push by enabling a simple Git config setting.
Learn how to view the last commit in Git using the git log
command.
Learn how to view a short summary of your Git commits using git log.
Learn how to leverage the power of git grep
to find matching files in your repository.
Is your Git repository getting bloated? Optimize it by garbage collecting loose objects.
Learn how to fetch the latest changes from the remote repository in Git and keep your local repository up to date.
Learn how to create a new commit in Git, along with tricks to skip Git hooks and create empty commits.
Learn how to eliminate the annoyance of copying dollar signs ($) along with terminal commands from the web with a simple bash alias.
Tired of manually specifying the remote branch name when pushing? Configure Git to use the current branch name as the default.
Manually or automatically find which commit in history introduced a bug using.
Learn how to view the current status of the working tree in Git.
Learn how to effortlessly amend the last commit's message or contents using Git and fix any mistakes you might have made.
Made a mistake with your branch name? Learn how to rename a local or remote Git branch.