Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PyCharm Auto Pull when Creating Git Branch

Tags:

pycharm

Does anyone know if there is a way to automatically perform a pull on a git branch before you create a local git branch within PyCharm?

like image 322
felix001 Avatar asked Nov 08 '22 00:11

felix001


1 Answers

There is not an official way as of the moment (PyCharm 2016.3) but I can suggest a similar work-around that worked successfully in another case: PyCharm: Switch between Code and Run/Terminal with CapsLock-u and CapsLock-n

Record a macro with the instruction given in the linked answer that:

  1. Pulls from the current branch (Ctrl + T and then hit Enter)
  2. Hit Alt+S (opens the VCS dropdown menu from the tool bar)
  3. Hit Alt+G (selects the Git on this dropdown and opens an expansion box)
  4. Hit Alt+B (opens the brances selection menu)
  5. Hit Enter (on the above mentioned selection menu the first choice is the "+ New Branch")
  6. Stop recording the macro, give it a name and assign it a hot key if you want from the Settings > Keymap.

Now you have a macro that when you hit it, pulls from the current branch and starts the creation of a new branch in which you only have to enter the name of the new branch!

Note: This macro is suggested under the assumption that you are creating a new branch on Git and on Linux. Your setting maybe different so you will have to adjust the process!

Good luck :)

like image 67
John Moutafis Avatar answered Jan 04 '23 03:01

John Moutafis