Git Problems

Solutions to Common Issues

Branching

How do you create a Git branch?

See how you can create and checkout a branch with the same command… Learn More

How do you rename a Git branch?

You can rename a Git branch using the git branch command followed by… Learn More

How do you switch a Git branch?

To switch to a Git branch, you’re going to use the git checkout command followed by the branch name… Learn More

How do you checkout a remote Git branch?

To checkout a remote Git branch you will use the git checkout command followed by the branch… Learn More

How do you delete a Git branch locally?

Delete a Git branch locally using the git branch command followed by… Learn More

How do you delete a remote Git branch?

Deleting a remote Git branch works differently than deleting a Git branch locally… Learn More

How do you view your Git branch list?

To view a list of your Git branches, you can run the git branch command… Learn More

How do you merge a Git branch?

To merge a feature branch into master, you will first need to… Learn More

How do you set an upstream branch in Git?

You will use the git push command to set an upstream branch… Learn More

How do you pull a remote Git branch?

To fetch changes from a remote Git branch, you’re going to use the git pull command. Learn how to use fast foward only, merge, or rebase when combining file changes in Git… Learn More


Checkout

How do you Git checkout a commit?

If you want to see when a specific behavior was introduced, you want to Git checkout a commit. Learn how to checkout a commit using the commit hash in the command line. Learn More

How do you checkout a Git tag?

Learn how to use the Git checkout command to checkout a Git tag as a branch or in a detached head state. Run the Git tag command to view the tags in your repository. Learn More


Cherry Pick

Can you cherry pick from another repository in Git?

It is possible to cherry pick from another repo using the command line… Learn More

Can you cherry pick multiple commits?

Git 1.7.2 introduced the ability to cherry pick a range of commits… Learn More


Commit

How to Revert a Commit in Git

To undo a Git commit you can use the git revert command. Learn how to revert changes in Git, revert multiple commits, and change your Git commit message in the process… Learn More

How to Amend a Git Commit Message

If you’ve made a mistake in your last commit, use the Git amend command to edit a Git commit message, or amend your last commit to change its content. Learn More


Pull

Git Pull vs Fetch

Compare the Git fetch vs Git pull actions and when you should use which command to get changes from your remote repository, and get a refresher on how to pull a remote branch. Learn More


Rebase

How do you perform an interactive rebase?

If you want to undo a Git commit that is not your last commit and you don’t want to loose any work, you can use this tool. Learn More

When to Git rebase vs merge?

How do you decide whether to perform a Git rebase or a Git merge? There are related benefits and risk to both. Learn when to use Git merge vs rebase… Learn More

How do you Git rebase a branch?

Learn how to Git rebase a master branch, and see what happens when a conflict occurs… Learn More

Additional Resources

Make Git Easier, Safer &
More Powerful

with GitKraken