Forums

Git workflow using web editor and local repo

Hi. I've been trying to figure out how exactly to integrate using the web editor and edits on a local git repo.

I'm definitely not great with Git, but have used it for work on other sites. I'm also not interested in having multiple people accessing the same repo, as all the dev on PA will be a one man shop for the foreseeable future.

I have built a functioning site on PA and have really enjoyed using the web editor. But I'd also like to use winmerge on the desktop for reviewing changes, so want to have a local repo I can pull and push from. So I am basically looking for the simplest way to allow myself to keep using the web editor and all the configurations I've set in PA (like static files) and having a local git repo.

I've read through and attempted things in the following posts: https://blog.pythonanywhere.com/87/

https://blog.pythonanywhere.com/43/

https://www.pythonanywhere.com/forums/topic/295/

However, I'm quite confused about the bare repo and where the code would then exist on PA. It mentions creating a clone on PA to also push to the bare repo, but I get lost trying to do that and at best it copies my entire file structure in the bare repo folder when I try. I don't understand where to find files to edit in the web editor using the PA file browser.

Is there a simple way to do this?

Thanks for any help.

That bare repo blog post is if you want your pythonanywhere webapp to automatically get any changes pushed and automatically reload it etc.

You just need to 1. setup a github/bitbucket repo 2. setup repo's on both your PA account and your local desktop 3. whenever you make changes on PA, commit and push it to the github/bitbucket repo ("the remote"), and pull down the changes on your local desktop from the remote. 4. similarly, whenever you make changes locally, you can commit and push it to the remote, and then on PA you can pull down the changes.

Great, thank you Conrad.

Really helpful and I finally have things set up now. Not sure why I did not grasp that workflow before, but those few steps really helped clarify for me that my local and PA are equal and just need to connect to the same remote.

I also did not realize the main point of the bare repo blog post's was the automation, so it was overkill for me.

I setup a remote on bitbucket. I referenced the steps on this site to make the bitbucket connection which were really helpful if anyone else is looking: https://nathanwailes.atlassian.net/wiki/x/fYCJAQ

Thanks.

Excellent, glad you got it working -- and thanks for posting the link!