![]() This article covered some of the basics of Git to try and help people starting out, or for those who might need a refresher. We made it to the end! I hope this article was helpful, and that you were able to learn about, and be more comfortable with Git and GitHub. Git stash apply n (in our case n = 1) □Conclusion This will keep it in your git stash and it is useful if you want to apply the same changes in multiple branches. In order to get those, we’ll use a git stash apply 1. Now, with a couple of changes stashed, we’re going to do a git stash list to see our list of stashed changes. Then, we’re going to do another git stash to get rid of those changes. We’ll run another git status to verify the changes were made. We’re going to edit the README with nano again. ![]() Git status again □Git stash list & applyĪlright, so we’re going to do a git stash again to get rid of our current changes. Once again, we’ll use git status, and verify that the changes are back. While the change do appear to be gone, we can easily retrieve it by doing git stash pop. With that done, we’ll use git status, and we can see that those changes are gone. Say we decide we don’t want or need those README changes at the moment we can use a git stash. In this instance, we can use a git diff, and it’ll show us the changes that were made. Now, we can see that the file is edited, but say we don’t know or remember what was changed. Stashing takes the dirty state of your working directory that is, your modified tracked files and staged changes and saves it on a stack of unfinished changes that you can reapply at any time (even on a different branch). After saving, I’ll use a git status to verify that the changes are showing up. The answer to this issue is the git stash command. From here, I’m going to open up my README file with nano and edit it. I’m going to be going to my console, and heading over to the blog repo I used last time. The answer to this issue is the git stash command. This command is used to reapply a git stash, but also keep it in your stashĪlright, now we’re going to move on to how to do a git diff.This command is used to display a list of your current stash entries.This command is used to retrieve your most recent stash made by popping it from your stash stack.This command is used to stash or remove the changes made to your working directory (no worries these haven’t gone up in smoke).This command is used to show changes between commits and the working tree.Now, we’ll move on to a brief rundown of the Git commands that will be used in this article, and then follow it up with how to use each of them. If you haven’t opened up a GitHub account, I recommend going to GitHub, creating an account, setting up a repository and following this guide before continuing on. This article is written under the assumption that you have already made a GitHub repository or have access to one, and that you also have a basic understanding of the command line. Today’s article will cover some of the basics of Git.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |