Reputation: 1222
If I have two branches, master
and new-feature
, can I run a program that uses master
then switch to new-feature
without effecting the original program?
Upvotes: 3
Views: 1183
Reputation: 126
You can use git checkout new-feature
to switch to the code for the feature.
This way, you can work on it as you like, without effecting the live site at master
.
Upvotes: 0
Reputation: 22017
At least these two possibilities to consider :
1) Clone your repo. Work on one repo, let the other one run your program. It seems the most straightforward way to go from what you describe.
2) Maybe look at git worktree
It allows you to check out multiple branches at once, in separate directories.
Your program could run on a version from branch A, while you work on branch B checked out on your second worktree.
Upvotes: 3