psychopy.org | Reference | Downloads | Github

How should I work with branches as a developer?

I’m trying to work on someone else’s experiment.
They have set me as a developer and I downloaded a copy of the experiment.

However, I can’t sync because the master branch is protected.

GitLab: You are not allowed to push code to protected branches on this project. **
** ! [remote rejected] master -> master (pre-receive hook declined)

I created a branch, but I can’t work out how to set PsychoPy to sync with it. Do I need to ask the owner to set it as default?

Oddly the default settings of gitlab make the master branch ‘protected’ by default. (The idea in software development is that most developers shouldn’t be allowed to push directly to the master branch because code needs reviewing/testing before it gets accepted for that).

The policy can be changed on a per-project basis in the project settings here:

That leads you to settings that includes “Protected Branches”. You could set push and merge to be allowed from Developers there.

Thanks for the workaround. How is it supposed to work? How am I supposed to be able to sync with a branch I created in someone else’s project?

Yes, either you create a branch and the owner can “merge” that branch into master (which is what run.pavlovia.org will use) or you create a Fork and submit a “Pull Request” for the owner to pull in your changes.

I’ll look though and see if we can adapt/relax the policy in the site preferences. They make sense for software development, which is the target audience of Gitlab, but it’s a bit too stringent for experiment development, where the users are less skilled

I did create a branch but couldn’t work out how to tell PsychoPy to sync with it.

That isn’t exposed from within PsychoPy yet. You’d have to go to the command line and start running git commands or, alternatively work with something like Gitkraken. Until we start adding or own interfaces for this it isn’t something we can really support though (git is massive with a million features and million ways to break things)