filmov
tv
Git reset hard vs soft: What's the difference?
Показать описание
When you do a git reset, you have two options:
- git reset hard
- git reset soft
So, which one should you choose?
Well, the difference between git reset hard vs soft comes down to what happens to the files in your Git worktree, or workspace, or whatever you want to call it.
With git reset soft, your files are left alone, while a git reset hard resets the files on the filesystem as well.
I always do a git reset hard instead of a git reset soft.
- git reset hard
- git reset soft
So, which one should you choose?
Well, the difference between git reset hard vs soft comes down to what happens to the files in your Git worktree, or workspace, or whatever you want to call it.
With git reset soft, your files are left alone, while a git reset hard resets the files on the filesystem as well.
I always do a git reset hard instead of a git reset soft.
Комментарии