Branching and merging

Branching and merging processes can be accomplished quite effortlessly in PyCharm. In the bottom-right corner of your project window, click on the Git button, which will bring up the following dropdown in which we can manage the branches for our project:

Management of branches in PyCharm

As you can see, in this menu we can create a new branch for our project. Go ahead and create a new branch and make a change to the main.py file in our project. For example, I named my new branch branch1 and changed the code in main.py too:

if __name__ == '__main__':    print('Hello from Version Control!')    print('Change in branch 1.')

From ...

Get Hands-On Application Development with PyCharm now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.