How do I connect my python spyder with github?

PythonGithubSpyder

Python Problem Overview


Is there any way to connect python spyder with github?

I manage my R scripts via github, because R provides with interfaces that enables users to commit, pull and push, but I wonder if there is same(or similar) system in python(x,y) spyder.

I want to manage my python scripts with github, not just locally editing my codes and manually write change logs on my hand every time...

Python Solutions


Solution 1 - Python

A command line git has been integrated into Spyder.

https://github.com/spyder-ide/spyder/issues/6105

> First right click the tab corresponding to any file in your repository and click "set console working directory." > > Then go to the Ipython window in Spyder and simply type your git commands (assuming Git is installed and its paths are configured properly) but append a "!" to the beginning of your command: > > > !git add "file.py" > !git commit -m "My commit" > !git push origin master >

Solution 2 - Python

(Spyder developer here) I'm sorry but right now (February 2017) there's no integration between Spyder and Git/Github.

Besides, there are no concrete plans to add this support. We could it in a year or year and a half.

Related issue on github: https://github.com/spyder-ide/spyder/issues/816

Solution 3 - Python

+1 @betontalpfa. For me, I wanted to put a local file to an existing Github.com repository through Spyder ipython console.

So, instead of clicking "set console working directory", I just did the following in ipython console within Spyder (I'm on Mac OSX Mojave, and have installed Xcode already from the Appstore):

  • Init working directory as a git directory

    !git init
    
  • Pull existing repository to merge with files you want to push

    !git remote add origin https://github.com/myUserName/sample.git
    
  • Add the file to local git

    !git add temp.py
    
  • Push the file to github.com

    !git push -u origin master
    

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionritosView Question on Stackoverflow
Solution 1 - PythonbetontalpfaView Answer on Stackoverflow
Solution 2 - PythonCarlos CordobaView Answer on Stackoverflow
Solution 3 - PythonbeholdView Answer on Stackoverflow