omz:forum

    • Register
    • Login
    • Search
    • Recent
    • Popular

    Welcome!

    This is the community forum for my apps Pythonista and Editorial.

    For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.


    StaSh and Git Cmd problems

    Pythonista
    git stash
    3
    15
    9254
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Phuket2
      Phuket2 @JonB last edited by

      @JonB, yeah!!!!!!!!!!!!
      Thanks a lot. I was missing the git add in my workflow, push is working now. Well it was always working, it was pushing what it knew about. PyCharm also has the add, but i sort of missed it, as it appears its outside the workflow, but now I understand its not.

      I also seen in your tutorial you pass the name of the dir you want for the cloned repo, I hadn't done that. I will try that later, I am guessing that will fix the naming of my dir for the cloned project folder.

      Honestly, thanks again. I know I have tried to get my head around using git before and failed. This time I am determined to get it all working. If I want to do anything half serious with PythonAnywhere or similar services I really don't have a choice.

      But I am getting there now, slowly.

      1 Reply Last reply Reply Quote 0
      • Phuket2
        Phuket2 @JonB last edited by

        @JonB , just side note. I just did a simple search and found this link for doing bash jupyter notebooks. I know there are not enough hours in the day as it is. But someone reading here might get inspired. I assume that with a bash kernel or whatever you call it, you could do your tutorial in the notebook and it would be like doing it StaSh.

        I just discovered today PyCharm has a built in Jupyter Notebook editor built into the GUI :( . I have launched it from the terminal before into the web browser.
        I have been going at a snails pace learning. Oh, well. It's still fun

        1 Reply Last reply Reply Quote 0
        • Phuket2
          Phuket2 last edited by

          For anyone reading, I found out git add . (Dot), Does not add everything in the dir, an error is created. from what I read I think it's suppose to. But wildcards work, i.e git add *.py or git add . both work.
          git commit . , appears to commit everything in the directory.

          1 Reply Last reply Reply Quote 0
          • mikael
            mikael last edited by

            I have this simple alias in .stashrc. It adds, commits and pushes all modified files.

            alias gup='git add `git modified`; git commit; git push'
            
            Phuket2 2 Replies Last reply Reply Quote 1
            • Phuket2
              Phuket2 @mikael last edited by

              @mikael , not sure why, but your alias did work for me. But fantastic to know about the alias cmd...
              I did - alias guppie='clear; git add (star.star) ; git status; git commit . ; git push'
              And it works as I expected it to. I could not work out how to escape the asterisk:(

              The output from when I run up is below. Hmmm, however as I was writing this it dawned on me it's different. You are adding modified, I am adding all were you are adding modified. So if I rung up and there is a modified file it does work. If there is nothing modified only new files, you get the msg below.
              But thanks, it's been super helpful

              [lords_project]$ gup
              Adding
              stash: <type 'exceptions.IOError'>: [Errno 21] Is a directory: '/private/var/mobile/Containers/Shared/AppGroup/3533032E-E336-4C25-BBC4-112A6BF2AF75/Pythonista3/Documents/MyDeployments/lords_project/'

              Commit Message:
              1a519e20424aedc23e01b46e7014bb7d45785f2a
              Attempting to push to: https://github.com/Phuket2/lords_project.git, branch: refs/heads/master
              Push to https://Phuket2:*******@github.com/Phuket2/lords_project.git successful.

              success!
              [lords_project]$

              1 Reply Last reply Reply Quote 0
              • Phuket2
                Phuket2 @mikael last edited by

                @mikael , do you know about .jpg files being in a repo. .jpg files seems to screw things up. When I run my guppie cmd with a .jpg in the dir I get the below. I am guessing binary data can not be sent

                Adding Created_in_git.py
                Adding IMG_1470.PNG
                Adding README.md
                Adding junk.py
                Adding mypyuifile.pyui
                Adding program.py
                Adding test1.py
                Adding test2.py
                Adding test3.py
                Adding test4.py
                STAGED
                add['IMG_1470.PNG']
                UNSTAGED LOCAL MODS
                []
                f9bc619d876e6ab9e206ad3e565e6c2851677a28
                Attempting to push to: https://github.com/Phuket2/lords_project.git, branch: refs/heads/master
                stash: <class 'urllib2.URLError'>: <urlopen error [Errno 32] Broken pipe>

                [lords_project]$

                mikael 1 Reply Last reply Reply Quote 0
                • mikael
                  mikael @Phuket2 last edited by

                  @Phuket2, see this.

                  Phuket2 2 Replies Last reply Reply Quote 1
                  • Phuket2
                    Phuket2 @mikael last edited by

                    @mikael , thanks. Yeah, I get exactly same as you. Can not recover. I tried git reset --hard etc. nothing seems to work to get it back in shape. Looks like it's still unresolved.
                    But really, I am very happy with what I have managed to get working so far with your guys help. It's a miracle for me :) black magic. I will just avoid bin files for the moment. If I do need one, I will try to add it another way and pull it down (hopefully)
                    Thanks again

                    1 Reply Last reply Reply Quote 0
                    • Phuket2
                      Phuket2 @mikael last edited by

                      @mikael , just to let you know. I uploaded a .jpg file into the repo with Github web client. The pull from StaSh was successful.

                      mikael 1 Reply Last reply Reply Quote 0
                      • mikael
                        mikael @Phuket2 last edited by

                        @Phuket2, yes, that works. However, working from an iPhone, I have yet to find the place where you can rename the uploaded file in the Github web interface.

                        Phuket2 1 Reply Last reply Reply Quote 0
                        • Phuket2
                          Phuket2 @mikael last edited by

                          @mikael , on my ipad I could also not see a way to rename it in the. Web interface. I cloned the repo in working copy. I could rename it there.
                          Then I did a pull in StaSh and ended up with a new image file and the old one was still in my Pythonista dir. Maybe I should have used merge or something, I am not sure

                          1 Reply Last reply Reply Quote 0
                          • JonB
                            JonB last edited by ccc

                            iirc the stash git tutorial had a review of how to use ssh-keygen, and then how to upload to git. Then you can use git remote to add a link to the ssh://git@github.com/tourname/yourrepo.git url, (i usually name it sshorigin) then git push sshorigin should work. I think there is a size limit for the https in dulwich.

                            1 Reply Last reply Reply Quote 0
                            • First post
                              Last post
                            Powered by NodeBB Forums | Contributors