Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

git checkout/reset commit_hash with link

For example next path:
https://github.com/php/php-src/commit/7245bff300d3fa8bacbef7897ff080a6f1c23eba?w=1

git clone https://github.com/php-src/php-src.git

git reset –hard 7245bff300d3fa8bacbef7897ff080a6f1c23eba?w=1

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

fatal: Cannot do hard reset with paths.

Same problem for checkout

How can I do ‘git reset’ with commit_hash(7245bff300d3fa8bacbef7897ff080a6f1c23eba) with link=’?w=1′

>Solution :

You cannot do git reset --hard to a file, only to a commit:

git reset --hard 7245bff300d3fa8bacbef7897ff080a6f1c23eba

You can checkout a single file from a commit to the current worktree:

git checkout 7245bff300d3fa8bacbef7897ff080a6f1c23eba ext/spl/spl_directory.c
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading