![]() ![]() Then, when it comes time to open a pull request, you’ll be certain that your changes work, but you’ll also be certain that your pull request-as well as theirs-only contains the changes that it really needs. You can test out your changes in those branches to see if they fix the bug before committing them to your own branch. You can use git stash to apply your changes to those other branches without committing them. There are lots of good reasons to try to limit the size of a branch’s changeset. While that’s OK if you’re the primary person working on that branch, if you’re helping to patch a bug for some teammates you might not want to commit your changes to their branches, too. Merging modifies the history of the branch you’d be working on. This beats merging your branch into those branches. So, if you’re working on a patch for a particular bug, you could stash changes, then try to apply them to multiple feature branches to make sure that your fix works. One nice feature of git stash is that applying the changes doesn’t remove them from the list of stashed states. Later, you can apply those changes from a list of stashed changes-either on your current branch or on a different branch after you switch branches. What Is git stash?Īs we mentioned, git stash is a tool that removes the working changes from your current branch and saves them as a diff. But it does remove them from the current branch and return it to the state it was in the last time you committed. In fact, Git saves them for you on your local computer for as long as you keep the repository on that hard drive. Git calls this tool “ stash,” and it lets you take your current changes and magically zip them away from view. ![]() You need to switch to the release branch, but you don’t want to permanently include your changes on your current feature branch.įortunately, there’s a tool for that. You want to help them try to reproduce the bug, but your changes aren’t ready to commit. Someone on your team needs a hand troubleshooting a critical bug. You’re heads-down on an important feature when your Slack notifications suddenly start pinging. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |