Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in DevOps and Agile by (29.3k points)

I've been editing some modules on the master branch but I haven't committed them. I'm now thinking that these changes should really be on an experimental branch and not the master branch.

How can I get these edits into an experimental branch? Copy them to some temp location, create the branch, and then copy them back in?

And how do I configure things so that when I do a git push from the new experimental branch it will it go into a branch of the same name in my GitHub repo?

1 Answer

0 votes
by (50.2k points)

For this question, you can simply check out a new branch and then you can commit it.

For that use the following commands:

git checkout -b <branch-name>

git commit

Checkout a branch will not discard your changes.

Thus, you can put current changes in a new git branch.

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...