# Updates were rejected because the remote contains work that you do

**URL:** <https://discourse.psychopy.org/t/updates-were-rejected-because-the-remote-contains-work-that-you-do/5409>\
**Category:** Online experiments\
**Created:** [September 25, 2018, 2:16pm UTC](https://discourse.psychopy.org/t/updates-were-rejected-because-the-remote-contains-work-that-you-do/5409 "2018-09-25T14:16:15Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Chengyang](https://avatars.discourse-cdn.com/v4/letter/c/35a633/32.png) [@Chengyang](https://discourse.psychopy.org/u/Chengyang)\
**Post date:** [September 25, 2018, 2:16pm UTC](https://discourse.psychopy.org/t/updates-were-rejected-because-the-remote-contains-work-that-you-do/5409/1 "2018-09-25T14:16:15Z")

</div>

Hi,  
I am new to git but used Psychopy for a while, and excited about the online function. Thanks for developing it!  
I have a old version experiment that already uploaded to the pavlovia, yesterday I copied that old version experiment file to another laptop mac with only Psychopy1.9 in it (because my mac still can’t install Psychopy3 properly…) and developed a new experiment (offline) based on that old experiment file. Today I want to upload this new experiment as a new project to pavlovia, but the problem happened. I copied code at below.

Basically, I opened that new experiment file with Psychopy3 and login Pavlovia in the Psychopy3 and then hit the new button that the small earth with refresh marker. problem comes…  
It seems this new experiment conflicted with the old experiment/project already on my pavlovia account.  
What should I do, I spend half day searching for the answer but failed… btw, I don’t really know how to play git…

Chengyang

Pushing files to PavloviaTraceback (most recent call last):  
File “C:\Program Files (x86)\PsychoPy3\lib\site-packages\psychopy\app\pavlovia\_ui\project.py”, line 455, in syncProject  
project.firstPush()  
File “C:\Program Files (x86)\PsychoPy3\lib\site-packages\psychopy\projects\pavlovia.py”, line 758, in firstPush  
self.repo.git.push(’-u’, ‘origin’, ‘master’)  
File “C:\Program Files (x86)\PsychoPy3\lib\site-packages\git\cmd.py”, line 548, in \<lambda\>  
return lambda \*args, \*\*kwargs: self.\_call\_process(name, \*args, \*\*kwargs)  
File “C:\Program Files (x86)\PsychoPy3\lib\site-packages\git\cmd.py”, line 1014, in \_call\_process  
return self.execute(call, \*\*exec\_kwargs)  
File “C:\Program Files (x86)\PsychoPy3\lib\site-packages\git\cmd.py”, line 825, in execute  
raise GitCommandError(command, status, stderr\_value, stdout\_value)  
git.exc.GitCommandError: Cmd(‘git’) failed due to: exit code(1)  
cmdline: git push -u origin master  
stderr: ‘To [https://gitlab.pavlovia.org/chengyang/cfmt\_chinese\_version.git](https://gitlab.pavlovia.org/chengyang/cfmt_chinese_version.git)  
! [rejected] master -\> master (fetch first)  
error: failed to push some refs to ‘[https://gitlab.pavlovia.org/chengyang/cfmt\_chinese\_version.git](https://gitlab.pavlovia.org/chengyang/cfmt_chinese_version.git)’  
hint: Updates were rejected because the remote contains work that you do  
hint: not have locally. This is usually caused by another repository pushing  
hint: to the same ref. You may want to first integrate the remote changes  
hint: (e.g., ‘git pull …’) before pushing again.  
hint: See the ‘Note about fast-forwards’ in ‘git push --help’ for details.’

---

<div class="post-metadata">

**Author:** ![yolinap](https://avatars.discourse-cdn.com/v4/letter/y/b5ac83/32.png) [@yolinap](https://discourse.psychopy.org/u/yolinap)\
**Post date:** [September 28, 2018, 6:48am UTC](https://discourse.psychopy.org/t/updates-were-rejected-because-the-remote-contains-work-that-you-do/5409/2 "2018-09-28T06:48:12Z")

</div>

Hey,

I haven’t been able to upload a single experiment yet.  
I’ve got absolutely the same errors, although using a single laptop.  
If i try to run the experiment online, the OK button is disabled.  
Has anyone found a solution yet?

When I try to pull (through Sync) the experiment from pavlovia - that is after an unsuccessful run of the experiment Online because of disabled OK button - I get the following error.

Traceback (most recent call last):  
File “C:\Program Files (x86)\PsychoPy3\_\lib\site-packages\psychopy\app\pavlovia\_ui\project.py”, line 364, in onSyncButton  
self.project.sync(syncPanel=syncPanel, progressHandler=progHandler)  
File “C:\Program Files (x86)\PsychoPy3\_\lib\site-packages\psychopy\projects\pavlovia.py”, line 607, in sync  
status = self.pull(syncPanel=syncPanel, progressHandler=progressHandler)  
File “C:\Program Files (x86)\PsychoPy3\_\lib\site-packages\psychopy\projects\pavlovia.py”, line 651, in pull  
raise e  
File “C:\Program Files (x86)\PsychoPy3\_\lib\site-packages\psychopy\projects\pavlovia.py”, line 642, in pull  
info = self.repo.git.pull() # progress=progressHandler  
File “C:\Program Files (x86)\PsychoPy3\_\lib\site-packages\git\cmd.py”, line 548, in   
return lambda \*args, \*\*kwargs: self._call\_process(name, \*args, \*\*kwargs)  
File "C:\Program Files (x86)\PsychoPy3_\lib\site-packages\git\cmd.py", line 1014, in _call\_process  
return self.execute(call, \*\*exec\_kwargs)  
File "C:\Program Files (x86)\PsychoPy3_\lib\site-packages\git\cmd.py", line 825, in execute  
raise GitCommandError(command, status, stderr\_value, stdout\_value)  
git.exc.GitCommandError: Cmd(‘git’) failed due to: exit code(1)  
cmdline: git pull  
stdout: ‘Updating 089f0d7…cf8baba’  
stderr: ‘From [https://gitlab.pavlovia.org/yolinap/test3](https://gitlab.pavlovia.org/yolinap/test3)  
089f0d7…cf8baba master -\> origin/master  
error: unable to create file data/test3\_PARTICIPANT\_001\_2018-09-28\_10:15:11.234.csv: Invalid argument’

Thank you for all your efforts for making open science, it is greatly appreciated!

---

<div class="post-metadata">

**Author:** ![Jin\_Jeon](https://avatars.discourse-cdn.com/v4/letter/j/43a26b/32.png) [@Jin\_Jeon](https://discourse.psychopy.org/u/Jin_Jeon)\
**Post date:** [September 28, 2018, 3:13pm UTC](https://discourse.psychopy.org/t/updates-were-rejected-because-the-remote-contains-work-that-you-do/5409/3 "2018-09-28T15:13:38Z")

</div>

I haven’t used Pavlovia, but my answer is based your git error message. I think the error message `"updates were rejected because the remote contains work that you do not have locally"` you get is because something has changed in the original file after you modified the project locally in your computer. So you would need to sync your local to match that in the original file.

Try:  
`git pull --rebase origin master`

Then try pushing it again with `git push origin master`

Hope it works 🙂

---

<div class="post-metadata">

**Author:** ![yolinap](https://avatars.discourse-cdn.com/v4/letter/y/b5ac83/32.png) [@yolinap](https://discourse.psychopy.org/u/yolinap)\
**Post date:** [September 30, 2018, 2:46pm UTC](https://discourse.psychopy.org/t/updates-were-rejected-because-the-remote-contains-work-that-you-do/5409/4 "2018-09-30T14:46:17Z")

</div>

Thank you for the response!  
I tried doing what you’ve suggested. It seemed that everything is okay after the pull and push (i got the ''Everything is updated" message).  
Unfortunately, when I tried to run the experiment the OK button was still disabled and the same errors appeared…  
Any other suggestions?

---

<div class="post-metadata">

**Author:** ![Chengyang](https://avatars.discourse-cdn.com/v4/letter/c/35a633/32.png) [@Chengyang](https://discourse.psychopy.org/u/Chengyang)\
**Post date:** [October 1, 2018, 3:49am UTC](https://discourse.psychopy.org/t/updates-were-rejected-because-the-remote-contains-work-that-you-do/5409/5 "2018-10-01T03:49:53Z")

</div>

hi,  
Thanks for your suggestion. I don’t have git knowledge. Can I ask some basic thing, plz? so I opened git bash and what should I do? I assume I shall change the work directory to the right fold?  
But anyway, I directly put ‘git pull --rebase origin master’, it comes with ‘git@gitlab.pavlovia.org’s password’. then I entered my password of my pavlovia account, it’s incorrect (show ‘permission denied, please try again’), so I assume it’s the password of the whole pavlovia in git? that impossible to have.

plz, tell me what shall I do.  
Thanks in advance!

---

<div class="post-metadata">

**Author:** ![Chengyang](https://avatars.discourse-cdn.com/v4/letter/c/35a633/32.png) [@Chengyang](https://discourse.psychopy.org/u/Chengyang)\
**Post date:** [October 1, 2018, 5:20am UTC](https://discourse.psychopy.org/t/updates-were-rejected-because-the-remote-contains-work-that-you-do/5409/6 "2018-10-01T05:20:29Z")

</div>

I found the answer… just ignore my last stupid question. I find I can right-click within the target folder and there is ‘git bash here’… and I typed git push origin master, and it works! Thank you so much! it kills me serval day, but finally, I survived…

---

<div class="post-metadata">

**Author:** ![yolinap](https://avatars.discourse-cdn.com/v4/letter/y/b5ac83/32.png) [@yolinap](https://discourse.psychopy.org/u/yolinap)\
**Post date:** [October 1, 2018, 5:47am UTC](https://discourse.psychopy.org/t/updates-were-rejected-because-the-remote-contains-work-that-you-do/5409/7 "2018-10-01T05:47:37Z")

</div>

It is great that it worked with you 🙂

But that makes me wonder even more why it does not work with me. I am doing the git pull and push to the point “Everything up-to-date”. Than I hit the Online run at PsychoPy, the red html warning pops up, I click Ok, and everything syncs again. After that the browser opens for entering participant’s number and session but the OK button there just stays disabled…

Yolina,  
PsychoPy3 3.0.0b9, Windows

---

<div class="post-metadata">

**Author:** ![Chengyang](https://avatars.discourse-cdn.com/v4/letter/c/35a633/32.png) [@Chengyang](https://discourse.psychopy.org/u/Chengyang)\
**Post date:** [October 5, 2018, 7:47am UTC](https://discourse.psychopy.org/t/updates-were-rejected-because-the-remote-contains-work-that-you-do/5409/8 "2018-10-05T07:47:49Z")

</div>

hi,  
I find a even simpler way to solve this problem…  
On the builder view, go to find ‘search pavlovia’ on the tool bar (the little earth with magnifying glass). Then tick My groups above the search bar and then find your current project (Name), then Browse… set the local root to your project folder on your computer then press Sync… (I think this is the same function as you type ‘git pull’ in the git cmd). After that, you can now go out to sync… your work without problem.  
Hopeful it works for someone have same problem as I was.

Chengyang

---

<div class="post-metadata">

**Author:** ![unagi\_pie](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/unagi_pie/32/3111_2.png) [@unagi\_pie](https://discourse.psychopy.org/u/unagi_pie)\
**Post date:** [October 11, 2018, 6:40pm UTC](https://discourse.psychopy.org/t/updates-were-rejected-because-the-remote-contains-work-that-you-do/5409/9 "2018-10-11T18:40:02Z")

</div>

Gitlab won’t let you push new files to your repository if there are files in there that haven’t been pulled to your local repository yet. At the moment, the csv output files are invalid because they contain a colon. So, if you want to push anything to gitlab, you will have to remove the csv files first. Once you do this, you will be able to sync.

I was having the same problem:

> [@Unable to creat file data when sync](https://discourse.psychopy.org/t/unable-to-creat-file-data-when-sync/5491/3):
>
> I’m having the same problem. However, I can’t delete the files online because it says that I can’t delete a file unless it is on a branch. How can I delete these files?

Now, I understand what was happening.
