3 Quick Git “Show-Me” Videos From Our IDE Family
Git is a fantastic and wildly popular version control system. Once you get beyond the basics, though, it can be a bit cryptic for civilians. Fortunately, this is an area where JetBrains IDEs can help, by putting a visual face on the underlying git commands.
Our colleagues in PhpStorm and IntelliJ recently tried a fun new approach at showing this. Since Git/GitHub support is largely shared across all of our IDEs, why not do a series of task-oriented, bite-sized screencasts featuring two IDEs tackling a certain Git workflow? And since version control, like so many of our features, is shared across IDEs…why not share their first 3 videos with our PyCharm folks?
How do I switch branches without losing my work?
You’re in the middle of heavy development. Your work is on a branch, which is the way the gods intended. However, you need to do something else — fix a bug on the master branch, review someone else’s work on a branch, etc. But you can’t switch off of your branch when you have uncommitted work.
Rather than do a “maybe this works” commit, you have several choices. This bite-sized video shows Trisha and Gary in a real-world scenario, letting their JetBrains IDEs (IntelliJ and PhpStorm) put a friendly face on the operations. And remember, PyCharm is the same for version control as the other JetBrains IDEs. Items covered:
- On a branch, in the middle of huge unfinished work porting to Php 7, but need to investigate a bug on that branch
- Use the IDE’s shelve feature to move changes out-of-the-way, instead of committing
- This restores the branch to its head state with no changes
- Later, “unshelve” to re-apply the changes, possibly to a new branch
I often find myself in this pattern. For example, I’m working on some feature. I get a bee in my bonnet and do some unrelated work, get myself into a bind, and need to…do something. With this, instead of committing, I can get the work off the branch and into a place where it belongs.
How to Keep a Git Fork up to Date?
Forking on GitHub is a wonderful facility, allowing people to modify code and even submit improvements back, without being added as a contributor to the main code base. But once you’ve forked, how do you stay up-to-date with the original?
- A local checkout with two remotes — the “upstream” original and the “origin” containing the personal fork
- Use fetch to non-destructively get a listing of the upstream’s changes, then a pull to get those changes from upstream into the local checkout
- Push those upstream changes into your fork i.e. the “origin” remote
How Do I Start Working with Open Source and GitHub?
Of course these two videos presume you already have a project checked out and ready to go. But how do you get started with open source? How do you get a project on GitHub into a fork and into your IDE?
- Find an interesting project and fork it into your personal GitHub organization
- Copy the URL for that fork and use it to start a new project in your IDE
- Track the original by adding the repository URL for the “upstream” remote
These three videos tackle specific workflows related to Git. If you find this approach interesting and have a suggestion for another video, put in a comment on the YouTube page for one of the videos. In fact, the third video was selected based on an earlier comment.
Subscribe to Blog updates
Thanks, we've got you!
PyCharm Edu 4 EAP: Integration with Stepik for EducatorsEarly Access Program
Integration with Stepik for Educators In 2016 we partnered with Stepik, a learning management and MOOC platform, to announce the Adaptive Python course. But if you want to create your own Python course with the help of PyCharm Edu, integration with Stepik may help you easily keep up your learning m…
PyCharm Edu 4 Early Access Program is OpenEarly Access Program
PyCharm Educational Edition follows its professional sibling and also starts the Early Access Program (EAP) for PyCharm Edu 4, available for free download now! What is EAP and why should you join? We at JetBrains believe that making tools for developers takes listening carefully to everyone who us…
Webinar Recording: Visual Debugging
Our April 25th webinar on Visual Debugging went quite well: just over 1 hour, a lot of fun, and covered nearly all of the topics. The recording is now available on YouTube. Additionally, the code and slides used are available in a GitHub repository. “Visually Debugging” is a theme that we plan to…
Let’s Write a Game: Hangout with PyLadies Pune
In early January I was invited by PyLadies Pune to do a hangout. We spent an hour writing a 2d game in Python, covering a number of Python development skills along the way. I’d love to repeat this, so if you have a meetup or user group and are interested, let me know. The recording is below...let’s …