I'm using git to manage source code update for application. I should work on INT branch…
- User
I'm using git to manage source code update for application. I should work on INT branch but I forget to switch before I work, Now I'm on Prod branch and already made a commit. How to switch to INT branch without change current changes on my code
- Assistant
To move to the
INTbranch without losing your current changes on theProdbranch, you'll want to first create a new branch from your current commit. This way, you can save your changes and then switch to theINTbranch. Here’s how you can do it:-
Create a new branch from your current commit: This step will save your current work under a new branch. You can name it something meaningful (e.g.,
temp-work).bashgit checkout -b temp-work -
Switch to the
INTbranch: Now that you are on a new branch with your changes, you can switch to theINTbranch.bashgit checkout INT
-