{"id":3455,"date":"2017-04-30T18:00:56","date_gmt":"2017-04-30T17:00:56","guid":{"rendered":"http:\/\/www.blopig.com\/blog\/?p=3455"},"modified":"2017-04-30T18:00:56","modified_gmt":"2017-04-30T17:00:56","slug":"bitbucket-and-pycharm-tools-to-make-a-dphil-less-problematic","status":"publish","type":"post","link":"https:\/\/www.blopig.com\/blog\/2017\/04\/bitbucket-and-pycharm-tools-to-make-a-dphil-less-problematic\/","title":{"rendered":"Bitbucket and PyCharm &#8211; Tools to make a DPhil less problematic"},"content":{"rendered":"<p>I find Git a wonderful tool for my work, with version control providing much needed damage control to my projects. I also find Git incredibly powerful at making my working life easier, with the ability to use git push and git pull to synchronise my code between the various computers that I use for my DPhil. Via a <a href=\"https:\/\/bitbucket.org\/product\">BitBucket<\/a> account, providing a remote Git repository, I am able to move my code around to wherever I am working and allow more room for either more procrastination or staring at my screen in confusion.<\/p>\n<p>As simple as GIT is, it can be a fiddle entering the git commands in command line as well as remembering to do this as you rush to leave the building. This has all been made much easier with <a href=\"https:\/\/www.jetbrains.com\/pycharm\/\">PyCharm, from JetBrains<\/a>. This IDE (integrated development environment) has many tools including version control such as support for a variety of file types, PEP8 checks to ensure good quality code and its ability to work with ipython notebooks.<\/p>\n<p>I&#8217;ve put the following mini-tutorial together for those who want to make or bring in an existing repository to PyCharm and get version control working:<\/p>\n<p><!--more--><\/p>\n<p><strong>To clone a repository and get going in PyCharm:<\/strong><br \/>\n1) Make your repository, for this example I will use BitBucket:<br \/>\n<a href=\"https:\/\/i0.wp.com\/www.blopig.com\/blog\/wp-content\/uploads\/2017\/04\/Blopig1.png?ssl=1\"><img data-recalc-dims=\"1\" decoding=\"async\" loading=\"lazy\" class=\"size-medium wp-image-3456 aligncenter\" src=\"https:\/\/i0.wp.com\/www.blopig.com\/blog\/wp-content\/uploads\/2017\/04\/Blopig1.png?resize=300%2C163&#038;ssl=1\" alt=\"\" width=\"300\" height=\"163\" srcset=\"https:\/\/i0.wp.com\/www.blopig.com\/blog\/wp-content\/uploads\/2017\/04\/Blopig1.png?resize=300%2C163&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.blopig.com\/blog\/wp-content\/uploads\/2017\/04\/Blopig1.png?resize=768%2C416&amp;ssl=1 768w, https:\/\/i0.wp.com\/www.blopig.com\/blog\/wp-content\/uploads\/2017\/04\/Blopig1.png?resize=1024%2C555&amp;ssl=1 1024w, https:\/\/i0.wp.com\/www.blopig.com\/blog\/wp-content\/uploads\/2017\/04\/Blopig1.png?resize=624%2C338&amp;ssl=1 624w, https:\/\/i0.wp.com\/www.blopig.com\/blog\/wp-content\/uploads\/2017\/04\/Blopig1.png?w=1248&amp;ssl=1 1248w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><br \/>\n2) Open up PyCharm, then select &#8216;Check Out from Version Control&#8217; &gt; Bitbucket. You might be asked to log in at this stage, if you are using the account for the first time. It is also useful to say that there are many supported online repositories here e.g. Github.<br \/>\n<a href=\"https:\/\/i0.wp.com\/www.blopig.com\/blog\/wp-content\/uploads\/2017\/04\/Blopig3.png?ssl=1\"><img data-recalc-dims=\"1\" decoding=\"async\" loading=\"lazy\" class=\"wp-image-3457 aligncenter\" src=\"https:\/\/i0.wp.com\/www.blopig.com\/blog\/wp-content\/uploads\/2017\/04\/Blopig3.png?resize=179%2C188&#038;ssl=1\" alt=\"\" width=\"179\" height=\"188\" srcset=\"https:\/\/i0.wp.com\/www.blopig.com\/blog\/wp-content\/uploads\/2017\/04\/Blopig3.png?resize=286%2C300&amp;ssl=1 286w, https:\/\/i0.wp.com\/www.blopig.com\/blog\/wp-content\/uploads\/2017\/04\/Blopig3.png?w=602&amp;ssl=1 602w\" sizes=\"auto, (max-width: 179px) 100vw, 179px\" \/><\/a><a href=\"https:\/\/i0.wp.com\/www.blopig.com\/blog\/wp-content\/uploads\/2017\/04\/Blopig4.png?ssl=1\"><img data-recalc-dims=\"1\" decoding=\"async\" loading=\"lazy\" class=\"wp-image-3458 aligncenter\" src=\"https:\/\/i0.wp.com\/www.blopig.com\/blog\/wp-content\/uploads\/2017\/04\/Blopig4.png?resize=381%2C169&#038;ssl=1\" alt=\"\" width=\"381\" height=\"169\" srcset=\"https:\/\/i0.wp.com\/www.blopig.com\/blog\/wp-content\/uploads\/2017\/04\/Blopig4.png?resize=300%2C133&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.blopig.com\/blog\/wp-content\/uploads\/2017\/04\/Blopig4.png?resize=768%2C339&amp;ssl=1 768w, https:\/\/i0.wp.com\/www.blopig.com\/blog\/wp-content\/uploads\/2017\/04\/Blopig4.png?resize=1024%2C452&amp;ssl=1 1024w, https:\/\/i0.wp.com\/www.blopig.com\/blog\/wp-content\/uploads\/2017\/04\/Blopig4.png?resize=624%2C276&amp;ssl=1 624w, https:\/\/i0.wp.com\/www.blopig.com\/blog\/wp-content\/uploads\/2017\/04\/Blopig4.png?w=1168&amp;ssl=1 1168w\" sizes=\"auto, (max-width: 381px) 100vw, 381px\" \/><\/a><br \/>\n3) Select the repository from your account, where you would like it to clone to on your machine and give it a fetching name. When promoted, agree to make the directory.<\/p>\n<p><strong>To add a local file to your repository (&#8216;git add&#8217;):<\/strong><br \/>\nVCS &gt; Git &gt; Add<br \/>\nYou are now able to send it to your remote repository&#8230;<\/p>\n<p><strong>To push:<\/strong><br \/>\nVCS &gt; Git &gt; Push OR The useful green up arrow:<br \/>\n<a href=\"https:\/\/i0.wp.com\/www.blopig.com\/blog\/wp-content\/uploads\/2017\/04\/Blopig5.png?ssl=1\"><img data-recalc-dims=\"1\" decoding=\"async\" loading=\"lazy\" class=\"wp-image-3459 aligncenter\" src=\"https:\/\/i0.wp.com\/www.blopig.com\/blog\/wp-content\/uploads\/2017\/04\/Blopig5.png?resize=108%2C61&#038;ssl=1\" alt=\"\" width=\"108\" height=\"61\" srcset=\"https:\/\/i0.wp.com\/www.blopig.com\/blog\/wp-content\/uploads\/2017\/04\/Blopig5.png?w=152&amp;ssl=1 152w, https:\/\/i0.wp.com\/www.blopig.com\/blog\/wp-content\/uploads\/2017\/04\/Blopig5.png?resize=150%2C86&amp;ssl=1 150w\" sizes=\"auto, (max-width: 108px) 100vw, 108px\" \/><\/a><\/p>\n<p>Add a commit comment and then click Commit &gt; Commit &amp; Push.\u00a0You will get a nice pop up asking which branch to push it to, which will be the Master unless you&#8217;ve branched out.<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/www.blopig.com\/blog\/wp-content\/uploads\/2017\/04\/Blopig6.png?ssl=1\"><img data-recalc-dims=\"1\" decoding=\"async\" loading=\"lazy\" class=\" wp-image-3460 aligncenter\" src=\"https:\/\/i0.wp.com\/www.blopig.com\/blog\/wp-content\/uploads\/2017\/04\/Blopig6.png?resize=292%2C285&#038;ssl=1\" alt=\"\" width=\"292\" height=\"285\" srcset=\"https:\/\/i0.wp.com\/www.blopig.com\/blog\/wp-content\/uploads\/2017\/04\/Blopig6.png?resize=300%2C293&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.blopig.com\/blog\/wp-content\/uploads\/2017\/04\/Blopig6.png?resize=768%2C750&amp;ssl=1 768w, https:\/\/i0.wp.com\/www.blopig.com\/blog\/wp-content\/uploads\/2017\/04\/Blopig6.png?resize=1024%2C999&amp;ssl=1 1024w, https:\/\/i0.wp.com\/www.blopig.com\/blog\/wp-content\/uploads\/2017\/04\/Blopig6.png?resize=624%2C609&amp;ssl=1 624w, https:\/\/i0.wp.com\/www.blopig.com\/blog\/wp-content\/uploads\/2017\/04\/Blopig6.png?w=1586&amp;ssl=1 1586w, https:\/\/i0.wp.com\/www.blopig.com\/blog\/wp-content\/uploads\/2017\/04\/Blopig6.png?w=1250&amp;ssl=1 1250w\" sizes=\"auto, (max-width: 292px) 100vw, 292px\" \/><\/a><\/p>\n<p><strong>To pull from your remote repository to your local machine:<\/strong><br \/>\nVCS &gt; Git &gt;Pull OR The equally useful blue down button (above), assuming that you have already cloned the project to this local machine.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I find Git a wonderful tool for my work, with version control providing much needed damage control to my projects. I also find Git incredibly powerful at making my working life easier, with the ability to use git push and git pull to synchronise my code between the various computers that I use for my [&hellip;]<\/p>\n","protected":false},"author":37,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"nf_dc_page":"","wikipediapreview_detectlinks":true,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"ngg_post_thumbnail":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[29],"tags":[],"ppma_author":[525],"class_list":["post-3455","post","type-post","status-publish","format-standard","hentry","category-code"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"authors":[{"term_id":525,"user_id":37,"is_guest":0,"slug":"joe","display_name":"Joseph Bluck","avatar_url":"https:\/\/secure.gravatar.com\/avatar\/83982ffcf500f0fe47fec340fcf3c1c396ae844739c03da6c069f0a4552641bd?s=96&d=mm&r=g","0":null,"1":"","2":"","3":"","4":"","5":"","6":"","7":"","8":""}],"_links":{"self":[{"href":"https:\/\/www.blopig.com\/blog\/wp-json\/wp\/v2\/posts\/3455","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.blopig.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.blopig.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.blopig.com\/blog\/wp-json\/wp\/v2\/users\/37"}],"replies":[{"embeddable":true,"href":"https:\/\/www.blopig.com\/blog\/wp-json\/wp\/v2\/comments?post=3455"}],"version-history":[{"count":2,"href":"https:\/\/www.blopig.com\/blog\/wp-json\/wp\/v2\/posts\/3455\/revisions"}],"predecessor-version":[{"id":3463,"href":"https:\/\/www.blopig.com\/blog\/wp-json\/wp\/v2\/posts\/3455\/revisions\/3463"}],"wp:attachment":[{"href":"https:\/\/www.blopig.com\/blog\/wp-json\/wp\/v2\/media?parent=3455"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.blopig.com\/blog\/wp-json\/wp\/v2\/categories?post=3455"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.blopig.com\/blog\/wp-json\/wp\/v2\/tags?post=3455"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/www.blopig.com\/blog\/wp-json\/wp\/v2\/ppma_author?post=3455"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}