Some examples of how to use commands that we have learned today. The main difference between git reset and the git revert is that the revert command rewrites the commit history instead of discarding the history. DESCRIPTION In the first three forms, copy entries from to the index. For new Git users, it is easier to remember that git switch is for switching branches, git restore is for restoring a commit. Two new commands âgit switchâ and âgit restoreâ are introduced to split âchecking out a branch to work on advancing its historyâ and âchecking out paths out of the index and/or a tree-ish to work on advancing the current historyâ out of the single âgit checkoutâ command. Nice and simple! Letâs have a look at the related part of release notes. git restore to restore working tree files.It is common to specify the source tree by naming a commit, branch or tag associated with. Why the hell should we use a single git checkout command to perform such different actions? Turns out that Git 2.23 added much more descriptive commands: Restore the working tree files with the content from the given tree. Switching branches and restoring files to its initial state are very common operations. I jumped on the docs, learned a thing and now it is time to share it with you. Instant WTF moment! I have been using git for years and I have never come across this one. I was pair programming with my friend (hi Pedro), we finished a feature and then he jumped to the command line to type git switch. The git restore command is used to restore the last committed change and remove the uncommitted local changes made after it.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |