How to Git Force Pull from Remote Branch?
When I was working on my Laravel application using the git bitbucket repository, I fetch a problem when first I did commit on my master branch I think I did 3 or 4 commits, and my project partner pull also in his local system, but we did wrong code in this commit so we required to remove that 3 or 4 commits from my bitbucket repository. he did remove that commits from his system but when I did pull but nothing to change, I also remove the cache but same.
But At last, I thought I thing I have to hard pull that's why I fired the following command. if you also face problem like this then let's see this command:
git fetch --all
git reset --hard origin/master
I hope it can help you...
We are Recommending you
- How to Remove File from Git Commit Before Push?
- How to Delete a Branch using Git Command?
- How to Rename Branch Name in Git Command?
- How to Switch Branch using Git Command?
- Github - How to Create New Branch using Git Command?
- How to Clone Github Repository using Command Line?
- How to Ignore Wildcard Files Name in Git using Gitignore?
- How to Ignore Folder in Git using Gitignore?
- How to Ignore File in Git using Gitignore?
- How to Git Ignore Some Files Locally?
- How to Clone a Git Repository into a Specific Folder?
- How to add git add remote origin on bitbucket repository ?
- How to find deleted file in git repo history log?