Reputation: 11
Could you please help me in order to see this changes from the PopUp branch but I dont want to lose the work that I have in the Pop Up branch.
The changes made in the form branch are totally separate (another section in HTML, here I also create a separate JS file and also a separate CSS file ) that the work that I am doing in the popUp branch but I would like to see the changes.
Thanks Happy coding ;)
When I move to the PopUp branch and check it with git status told me that is uptodate. I use terminal to interact with github.
Upvotes: 1
Views: 195
Reputation: 11
In order to solve this problem when I return to the popUp branch I merge this branch with the main branch. Thanks
Upvotes: 0
Reputation: 13903
Git provides a nice, albeit under-appreciated, solution to this problem: you can create secondary "work trees" for your repository, each with a different checked-out branch.
See the 'worktree' tag and in particular What would I use git-worktree for? for good descriptions and discussions on this topic.
This is a legitimate use case and it comes up all the time. The typical recommendation is to use git stash
in order to switch from working on one task to the other, but I find this incredibly disruptive. Having multiple Git worktrees has been a lifesaver many times when I was in the middle of working on something, and I needed to switch branches for a quick bugfix.
Upvotes: 1