ItSolutionStuff.com

How to Git Force Pull from Remote Branch?

By Hardik Savani • November 5, 2023
Git

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...

Tags: Git
Hardik Savani

Hardik Savani

I'm a full-stack developer, entrepreneur, and founder of ItSolutionStuff.com. Passionate about PHP, Laravel, JavaScript, and helping developers grow.

📺 Subscribe on YouTube

We Are Recommending You

How to Remove File from Git Commit Before Push?

Read Now →

How to Delete a Branch form GitHub Repository?

Read Now →

How to Rename Branch Name in Git Command?

Read Now →

How to Switch Branch using Git Command?

Read Now →

How to Create a New Branch on GitHub?

Read Now →

How to Clone Github Repository using Command Line?

Read Now →

How to Ignore Wildcard Files Name in Git using Gitignore?

Read Now →

How to Ignore Folder in Git using Gitignore?

Read Now →

How to Ignore File in Git using Gitignore?

Read Now →

How to Git Ignore Some Files Locally?

Read Now →

How to Clone a Git Repository into a Specific Folder?

Read Now →

How to Add Git Add Remote Origin on Bitbucket Repository?

Read Now →

Git - How to Find a Deleted File in Commit History?

Read Now →