Try git checkout -f master
.
-f
or --force
Source: https://www.kernel.org/pub/software/scm/git/docs/git-checkout.html
When switching branches, proceed even if the index or the working tree differs from HEAD. This is used to throw away local changes.
When checking out paths from the index, do not fail upon unmerged entries; instead, unmerged entries are ignored.
Related Posts:
- How do I check out a remote Git branch?
- What is git tag, How to create tags & How to checkout git remote tag(s)
- How do I revert a Git repository to a previous commit?
- How can I switch to another branch in git?
- How to get just one file from another branch?
- How do I revert a Git repository to a previous commit?
- How do I revert all local changes in Git managed project to previous state?
- How do I revert all local changes in Git managed project to previous state?
- How can I reset or revert a file to a specific revision?
- What’s the difference between git switch and git checkout
- git checkout tag, git pull fails in branch
- Git: How to update/checkout a single file from remote origin master?
- Git checkout – switching back to HEAD
- git checkout all the files
- How do I use ‘git reset –hard HEAD’ to revert to a previous commit? [duplicate]
- Git: Message ‘src refspec master does not match any’ when pushing commits in Git
- error: src refspec master does not match any
- How to cherry pick from 1 branch to another
- How to Git stash pop specific stash in 1.8.3?
- How to merge branch to master?
- What happens when I do git pull origin master in the develop branch?
- What is the `git restore` command and what is the difference between `git restore` and `git reset`?
- Git fetch remote branch
- Reset local repository branch to be just like remote repository HEAD
- How do I push a new local branch to a remote Git repository and track it too?
- Practical uses of git reset –soft?
- LF will be replaced by CRLF in git – What is that and is it important? [duplicate]
- github changes not staged for commit
- Git error: “Please make sure you have the correct access rights and the repository exists”
- Undoing a git rebase
- How do I pull my project from github?
- How to resolve merge conflicts in a Git repository
- Difference between Git and GitHub
- Could not open a connection to your authentication agent
- How do I resolve git saying “Commit your changes or stash them before you can merge”?
- Hard reset of a single file
- The following untracked working tree files would be overwritten by merge, but I don’t care
- How to compare files from two different branches
- Why do I have to “git push –set-upstream origin
“? - How do you create a remote Git branch?
- Move the most recent commit(s) to a new branch with Git
- rejected master -> master (non-fast-forward)
- How to name and retrieve a stash by name in git?
- Create a tag in a GitHub repository
- How can I delete a file from a Git repository?
- Git: Could not resolve host github.com error while cloning remote repository in git
- How to pull a specific branch from Github
- Make an existing Git branch track a remote branch?
- How to fully delete a git repository created with init?
- How do you create a remote Git branch?
- How do I update or sync a forked repository on GitHub?
- Else clause on Python while statement
- Git – Undo pushed commits
- How to remove the shallow clone warning from HomeBrew
- Git Giving “fetch first” error when trying to push
- Files not updating using ‘git pull’
- Pull request vs Merge request
- What is the difference between `git merge` and `git merge –no-ff`?
- The following untracked working tree files would be overwritten by merge, but I don’t care
- error: cannot lock ref.. ‘refs/tags’ exists; cannot create ‘refs/tags/
- Your configuration specifies to merge with the
from the remote, but no such ref was fetched.? - How can I copy the content of a branch to a new local branch?
- Git: “please tell me who you are” error
- ! [rejected] master -> master (fetch first)
- How to git add a whole folder
- How to change folder with git bash?
- Git:nothing added to commit but untracked files present
- Git how to clone with SSH key, username
- fatal: This operation must be run in a work tree
- How to replace local branch with remote branch entirely in Git?
- Git diff against a stash
- How to commit changes to another pre-existent branch
- How to revert a “git rm -r .”?
- “git checkout
” is changing branch to “no branch” - How do I push a local Git branch to master branch in the remote?
- How to clone git repository with specific revision/changeset?
- How to compare a local Git branch with its remote branch
- How do I list all of the files in a commit?
- Git keeps prompting me for a password
- How can I unstage my files again after making a local commit?
- Resolve Git merge conflicts in favor of their changes during a pull
- Git stash pop- needs merge, unable to refresh index
- Git – Remove commit from history
- Git merge without auto commit
- How to get Git to clone into current directory
- List submodules in a Git repository
- How can I reconcile detached HEAD with master/origin?
- How do you merge two Git repositories?
- How do I run git log to see changes only for a specific branch?
- How to get Git to clone into current directory
- How to search in commit messages using command line?
- How to get changes from another branch
- GIT_DISCOVERY_ACROSS_FILESYSTEM not set
- key_load_public: invalid format
- Difference between git stash pop and git stash apply
- git fetch doesn’t update my local repository
- How do I show the changes which have been staged?
- Git push hangs when pushing to Github?
- GIT and Development URL’s point to production
- Best workflow for Git theme development with plugins [closed]