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:
Commands:
git fetch --all
git reset --hard origin/master
I hope it can help you...
Hardik Savani
I'm a full-stack developer, entrepreneur and owner of ItSolutionstuff.com. I live in India and I love to write tutorials and tips that can help to other artisan. I am a big fan of PHP, Laravel, Angular, Vue, Node, Javascript, JQuery, Codeigniter and Bootstrap from the early stage. I believe in Hardworking and Consistency.
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?
- Git - How to Find a Deleted File in Commit History?