Forums

Updating new code

Hi, how is new code updated when I make changes in it? Will I need to clone in bash again to see the changes live? Or what is the process?

Thanks.

If you make changes using the editor inside PythonAnywhere, then you don't need do anything with git; code that runs in consoles can just be run by running it again, while if it's in a website's code you can tell the system to load up changed code by using the "Reload" button on the "Web" page.

If you've made code on your own machine, then you'll need to commit it, then push it to GitHub, then use git pull (not git clone) to pull the changes to PythonAnywhere, and then reload.

Hi All,

I have been deleting and re cloning my code in bash every time I make an update on my local computer (and push to git). I tried the above advice, but got the message: fatal: not a git repository (or any parent up to mount point /home) Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).

I am in the same bash console as that which I use to clone. Is there anything else I should do/look out for?

Thanks in advance!

It sounds like you need to use cd to navigate to the directory containing your repository. Sometimes console servers have to be reset, and when that happens your Bash process will be restarted, and you'll wind up back in your home dir.

Hi Giles,

Thanks for your reply.

I was in the directory in bash which has the ~ $ symbol. Staight after writing the above post I did the usual delete and re clone in the same bash session and that worked without any issues, so it seems I was in the right directory (or at least the same directory as before).

My understanding is that these two commands should both work from the same directory, so its confusing that they don't in the case of the PythonAnywhere bash. Any further thoughs/tips on best practice would be much appreciated!

PS I tried cd .. out of ~ $ and that took me to /home $ and in this place neither pull nor clone worked, with errors returned being fatal: not a git repository (or any of the parent directories): .git and fatal: could not create work tree dir 'dash_multi': Permission denied for pull and clone respectively.

git clone and git pull do not both work within the same directory. git clone creates a directory where your repository is cloned into and git pull needs to be run in the directory that git clone created. This is the case everywhere and is not particular to PythonAnywhere.