![]() ![]() ![]() This removes the last x commits (back to the hash you choose), and resets changes to files.The other reset command we'll look at is "git reset -hard " (again, defaults to HEAD, which is last committed state).ie: when you realize you weren't done making your changes and committed too early. Use this command when you want to remove the last x commits (back to the hash you choose) but keep changes to files in tact.The default reset command is "git reset " (where defaults to HEAD, which is last committed state). ![]() The seven character hash at the beginning of each line in that log is unique to and represents that commit. You can get the hash of the desired commit by typing "git log -oneline". When you use either version, you have the option to pass a commit hash to the command. The basic "git reset" and "git reset -hard". You can find the full list in the Git documentation, but I'm just going to show you two at this time. There are a number of options you can pass when using the "git reset" command. We can use the "git reset" command to reset our repo to a specified state. Let's say we've tested the update, and it causes a conflict with another module we're using. Now "git status" will show modified and untracked files. I'll start out by updating the Views module to the latest release. There are two commands that can do that for you "git reset" and "git revert". In the last video we saw how to reset a file or directory to it's last committed state, but what if you make a commit and then need to undo it?Īt some point you will make a commit, and then realize that it broke something, or the code just really wasn't ready to be committed. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |