phpStorm - Github Integration

Kaustubh Katdare

Kaustubh Katdare

@thebigk Oct 27, 2024
I'm pretty new to the phpStorm IDE and Github as well. I already have an account on Github and have spent time exploring it; but I'm still not familiar with the way it works. Here's what I'm trying to achieve:-
  1. I have two computers - my main workstation and a laptop, both installed with phpStorm.
  2. I want to backup my code-snippets from my main workstation to Github and then access it from my laptop - so that I can continue working on any machine at my will and yet have access to the latest code changes.
  3. I however do not want to backup entire framework; just the code files I have created.
If someone can tell me how do I go about it, I'd really appreciate it. Even pointers to the right resources would be of great help. I'm currently exploring various ways; and will update if I find anything shareworthy.

Thanks!

Replies

Welcome, guest

Join CrazyEngineers to reply, ask questions, and participate in conversations.

CrazyEngineers powered by Jatra Community Platform

  • Abhishek Rawal

    Abhishek Rawal

    @abhishek-fg9tRh Aug 13, 2015

    First set up git in your machine using #-Link-Snipped-#. If you've already setup git then, create a repo and push the code(#-Link-Snipped-#) from your workstation. Now, set up git in your laptop and clone your repo. Play with your code now, and once you're done just add file changes for commit (git add .), make local commit (git commit) and push to your repo (git push). It's almost same way like 2nd manual link of pushing code shown above.
  • Kaustubh Katdare

    Kaustubh Katdare

    @thebigk Aug 13, 2015

    Thanks. Let me explore this.
  • Manish Goyal

    Manish Goyal

    @manish-r2Hoep Aug 14, 2015

    create a repo on github and commit all code inside that repo using following commands

    git init
    git clone <repo url>
    git add <foldername>
    git commit -m "<message>"
    git push origin master (master is branch name or if you want then you can create new for different use for e.g you added a chat feature on website then you can create chat branch and add all the chat related code inside that branch

    Next whenever you are working on any system run following command
    git pull origin master

    that's it
  • Vishal Sharma

    Vishal Sharma

    @vishal-pysGmK Aug 15, 2015

    I have written a python script that uses oauth on bitbucket git repository to by pass username and password entry while cloning or pushing (to) a repo. Very vaguely written though. Will generalize and make a git repo for that..
  • Kaustubh Katdare

    Kaustubh Katdare

    @thebigk Aug 15, 2015

    Thanks a ton for all your responses folks. Turns out that it's super easy using the phpStorm-GitHub integration plugin. All I had to do was chip in my github credentials and then it enabled the github menu in the right-click options on folders. I can quickly backup all my files.

    I'm still very new to this.
  • Abhishek Rawal

    Abhishek Rawal

    @abhishek-fg9tRh Aug 15, 2015

    Kaustubh Katdare
    All I had to do was chip in my github credentials and then it enabled the github menu in the right-click options on folders. I can quickly backup all my files.
    GUI ruins the fun :/
  • Kaustubh Katdare

    Kaustubh Katdare

    @thebigk Aug 15, 2015

    Abhishek Rawal
    GUI ruins the fun :/
    I'd have agreed with you if we were in 2001 or 2002; the years I literally spent more time on the terminal prompt than the GUI. But over the period of time, it's the 'productivity' that becomes more important than getting into technicalities.

    ...and that's how I'm turning from an engineer to a manager. Ouch! 😲
  • Abhishek Rawal

    Abhishek Rawal

    @abhishek-fg9tRh Aug 15, 2015

    Kaustubh Katdare
    But over the period of time, it's the 'productivity' that becomes more important than getting into technicalities.
    You're mistaken here buddy. CLI increases productivity much more than one can even imagine. Even now if I have to make any changes into file system, I use konsole even though 'Dolphin File Manager' has all he available services, because it is simpler and faster.

    But again, to each his own 😀