Enable Dark Mode!
how-to-setup-version-control-using-git-pycharm.jpg
By: Nimisha Muralidhar

How to Setup Version Control Using Git in Pycharm

Technical

In the current scenario, when teammates are working remotely on the same project, git plays a very important role in the development of a project. Developers can easily create a repository in the GitHub account and merge the code.
It is helpful to control the git directly from pycharm.
This blog will describe how version control is done using git in pycharm?
Pycharm supports various version control systems, which helps in codebase management.
Let see how it works:
Step 1: Log in to GitHub account
Go to  Pycharm -> File -> Settings -> Version Control -> Github
how-to-setup-version-control-using-git-pycharm-cybrosys
Click on the + button, where you can choose  Login via Github that will redirect to Github login via JetBrains.
how-to-setup-version-control-using-git-pycharm-cybrosys
Go to Authorise in Github
how-to-setup-version-control-using-git-pycharm-cybrosys
Give the necessary credentials and login to Github.
how-to-setup-version-control-using-git-pycharm-cybrosys
Once the login is successful, you can see the Github account has been logged in via pycharm (Pycharm -> File -> Settings -> Version Control -> Github)
Step 2: Create local git repository and clone
Create a folder (it will act as a local git repository). Here I created a folder named TestCybro in the project Odoo 14.0. 
Go to -> Git -> Clone
how-to-setup-version-control-using-git-pycharm-cybrosys

how-to-setup-version-control-using-git-pycharm-cybrosys
Choose the corresponding Github account (CybroOdoodev). In the repository URL, give the corresponding git repository from which it has to be cloned which is TestCybro in this case. Also in the directory, give the local folder that you have created, which will act as a local git repository(TestCybro) and clone.
Once cloning is done, one can view the contents of the git repository in the local git repository(TestCybro). By default, it will clone the main branch.
how-to-setup-version-control-using-git-pycharm-cybrosys
If you need to clone from a specific branch, 
Go to -> Local git repository (TestCybro) -> Right Click -> Git -> Branches -> Choose the branch you want -> Checkout. Here I need to clone from the branch 14.0-test.
how-to-setup-version-control-using-git-pycharm-cybrosys
Now you can see the branch 14.0-test has been cloned. Which has the module test_email.
how-to-setup-version-control-using-git-pycharm-cybrosys
Step 3: How To Commit
Here I removed security.xml from __manifest__.py (You can make the necessary changes as required). The file appears in blue color when the changes occur, else it appears in white color.
how-to-setup-version-control-using-git-pycharm-cybrosys
Go to -> Local git repository (TestCybro) -> Right Click -> Git -> Commit directory
how-to-setup-version-control-using-git-pycharm-cybrosys
You can see the changes (__manifest__.py) 
Add the commit message -> Commit
how-to-setup-version-control-using-git-pycharm-cybrosys
Here I did both commit and push separately. You can do it all at once by selecting Commit and Push. You are alerted with a success message if the commit is done
Step 4: How to push
Go to -> Local git repository (TestCybro) -> Right Click -> Git -> Push
how-to-setup-version-control-using-git-pycharm-cybrosys
One can see push the commits by clicking the Push-button. On the success of Push, you are depicted with a success message.
how-to-setup-version-control-using-git-pycharm-cybrosys
When you go to the specific branch where commits have been pushed, you can view the latest commit there.
how-to-setup-version-control-using-git-pycharm-cybrosys
This is how we can set up Version Control Using Git In Pycharm.


If you need any assistance in odoo, we are online, please chat with us.



0
Comments



Leave a comment

 


whatsapp_icon
location

Calicut

Cybrosys Technologies Pvt. Ltd.
Neospace, Kinfra Techno Park
Kakkancherry, Calicut
Kerala, India - 673635

location

Kochi

Cybrosys Technologies Pvt. Ltd.
1st Floor, Thapasya Building,
Infopark, Kakkanad,
Kochi, India - 682030.

location

Bangalore

Cybrosys Techno Solutions
The Estate, 8th Floor,
Dickenson Road,
Bangalore, India - 560042

Send Us A Message