![]() I have a strong preference for using temporary dev branches over the stash because it gives you a lot more control over what you put in and how you take it back out afterwards, although I agree there are also effective (and certainly quicker) workflows with the stash itself: it's a trade-off between speed and control. d will do if you actually merged it back in, but -D is needed if the branch is not actually merged but you have recovered the changes you wanted. With all options, you can delete the branch with git branch -D dev.temp when you're done with it. Option 3: cherry pick the commit so it's also committed in your working branch - this is the least like your workflow, however, since it leaves committed in `, but here it is for completeness: git cherry-pick dev.temp is now in the index use git reset to revert it to a locally changed file and keep working where you were at. Option 2: check out the file into your main branch: git checkout dev.temp git diff id del commit a comparar 1 id del commit a comparar 2 Nos. git log fichero muestra los commits guardados en el archivo. git show fichero muestra los cambios sufridos por en el archivo. Otherwise, just stash the files like normal, pull your origin, and optionally place. Consultar el estado de nuestros archivos en git: git status muestra en qué estado del ciclo de vida se encuentran los archivos. But that just makes your repo updated with your origin, so be careful. If you dont want to stash the working files, you can always do: git reset -hard origin/master. #work here, merge or rebase when you're done and your change go on-top of what was previously committed in your origin. Option 1: go the the branch and keep working there, with a merge or rebase when you're done: git checkout dev.temp git checkout -b dev.tempįrom here you have your "stashed" file in a branch so there are many ways to continue. It's more typing and more commands, but it gives you full control of the results afterwards. Some of these changes may also be staged in the index.Here is a workflow that accomplishes what you want using a branch, which is personally what I prefer to use instead of the stash. How git stash encodes your worktree and index as commits:īefore stashing, your worktree may contain changes to tracked files, untracked files, and ignored files.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |