We can use a commit’s identified (it’s “SHA”), or we can use an indirect reference. We can tell git to take us back in time to a previous commit as well.We do that by telling git which commit to rewind to. But git reset is more flexible than that. This version of resetting isn’t sufficient for our purposes. Normally, this command by itself tells git to unstage anything we’ve added with git add, but haven’t committed yet. git reset is how we tell git that we want to undo recent changes. What does this command do? Let’s break it apart a little bit. In this case, we can drop the last commit in its entirety. How complicated is the situation? The secret is in the last commit, and there’s nothing else in the last commit As a result, this command can take a very long time, if the repository is very large. We need to ensure we don’t just scrub our secret from a portion of the repository history. We have to do this, because it is possible that the commit containing the secret exists in more than one branch or tag. So this command tells git to download the entire repository history, a complete and total clone. And the -tags flag tells git to grab every tag as well. This flag tells git to grab every branch from the remote repository. But git is smart, it doesn’t pull everything down, only what’s needed. git pull tells git to grab updates from the remote repository, and apply them in the current branch (when it makes sense to do so, that is, when the local branch is set to track a remote branch). The last step will look a little bit familiar.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |