View the last Git commit
Learn how to view the last commit in Git using the git log command.
30 seconds of code contains a curated collection of code articles covering a wide range of development needs. The collection spans many topics, ranging from simple coding problems to theoretical concepts and development techniques.
Learn how to view the last commit in Git using the git log command.
Want to compare the changes between two branches in Git? Here's how you can do it.
Have you accidentally deleted a file? Or maybe you need to restore a file that was deleted? Here's how Git can help you.
Get the name of the current branch in Git.
View differences between staged or unstaged changes and the last commit in Git.
Learn how to create a new commit in Git, along with tricks to skip Git hooks and create empty commits.
Learn how to fetch the latest changes from the remote repository in Git and keep your local repository up to date.
Learn how to view or change the URL of the remote repository in Git.
Looking for a way to list all merged branches in your Git repository? Look no further.
Learn how to apply changes introduced by one or more commits to your current branch (cherry-picking).
If you need to copy a file from another branch to the current branch, here's an easy way to do it.
Learn how to force update a remote branch after rewriting the Git history locally.
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.
The first step is often the hardest, yet creating a Git repository is as simple as running a single command.
Rebase the current branch onto another branch in Git.
Is your Git repository getting bloated? Optimize it by garbage collecting loose objects.
If you're working with a team using different operating systems, configuring line endings can help maintain consistency.
Learn how to view the current status of the working tree in Git.
Made some changes you don't want to keep? Learn how to discard uncommitted or untracked changes in Git.
Learn how to open the Git configuration file in the Git text editor, for editing.
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.
Learn how to configure the text editor used by Git for commit messages and other text editing tasks.
Made a mistake with your branch name? Learn how to rename a local or remote Git branch.
Learn how to effectively use Git's staging area, by adding or removing files from it.