How To Reset GIT To Origin/master? - Maslosoft

× × × × × ×

How to disable service in Ubuntu 18.04?

How to select HTML element without attribute with CSS?

Home page Knowledge Base How to reset GIT to origin/master? How to reset GIT to origin/master?

git reset master composer

Sometimes - for instance in folder containing installed composer package - the repository might remain in confusing state. Like with detached head. It doesn't sound too nice!

Even git reset --hard might not help. First we need fetch origin, which is slightly different from pull, as it will not try to merge. To reset repository to our remote master we need to reset it hard specifying reset point to origin/master.

After this operation all uncommited changes will be lost

Reset to origin/master

git fetch origin git reset --hard origin/master

When in detached head state, also issue commands:

git checkout master git pull

To bring head back to the master.

You might also like:

How to create permanent redirect in PHP?

php http header redirect permanent

How to create permanent redirect in PHP?
How to remove array element in JavaScript?

javascript array arrays

How to remove array element in JavaScript?
How to continue script execution in background in PHP?

php background-processing nginx fpm

How to continue script execution in background in PHP?
How to disable service in Ubuntu 18.04?

ubuntu services boot reboot service

How to disable service in Ubuntu 18.04?
How to enable service to run on boot in Ubuntu 18.04?

ubuntu services boot reboot service

How to enable service to run on boot in Ubuntu 18.04?
How to list all services in Ubuntu 18.04?

18.04 ubuntu systemctl services bash 20.04

How to list all services in Ubuntu 18.04?
How to disable animations in Ubuntu 17.10 or 18.04?

ubuntu desktop 17.10 18.04

How to disable animations in Ubuntu 17.10 or 18.04?
How to list manually installed (added) packages in Ubuntu

ubuntu linux bash apt shell

How to list manually installed (added) packages in Ubuntu
  • Featured Products
  • Framework
  • Mangan
  • Manganel
  • Addendum
  • Signals
  • Embedi
  • Binder
  • Hedron
  • Staple
  • Awe Share
  • Playlist
  • Miniview
  • Whitelist
  • About
  • Contact
  • Privacy policy
  • External Resources
  • GitHub
  • Packagist

Contact us

Maslosoft LLC

16192 Coastal Highway Lewes, Delaware 19958, USA

[email protected]

+48 514 920 103

© 2012 - 2026 Maslosoft LLC

CMS and Hosting Bene Best

Tag » How To Reset Git Origin