Open savoisn opened 7 years ago
Is your repo initialized?
Yes, the repo is initialized and the content is even index based on the right branch.
NSA
Le 28 août 2017 7:08 PM, "Nicolas Giard" notifications@github.com a écrit :
Is your repo initialized?
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Requarks/wiki/issues/227#issuecomment-325414187, or mute the thread https://github.com/notifications/unsubscribe-auth/AAjMXclnnAxdTqp-FivJW3ZFn2IYeMbOks5scvQZgaJpZM4PEnym .
I have the same issue. I believe this is because the wrong branch name is being used:
2017-09-07T03:40:02.968Z - error: [AGENT] Unable to push changes to remote Git repository!
2017-09-07T03:40:02.969Z - error: [AGENT] One or more jobs have failed:
{ code: 1,
message: '`git --git-dir=repo/.git --work-tree=repo push origin wiki` failed with code 1',
stderr: 'error: src refspec wiki does not match any.\nerror: failed to push some refs to \'git@github.com:myorganisation/myrepo.git\'\n',
stdout: '' }
# docker exec -ti wikijs_wikijs_1 bash
bash-4.3# cd repo/
bash-4.3# git push origin wiki
error: src refspec wiki does not match any.
error: failed to push some refs to 'git@github.com:myorganisation/myrepo.git'
bash-4.3# git branch
* master
This is a bug, as the local branch isn't set before pushing to the remote branch. Use the master
branch for now.
Yes. The other workaround is to manually set the local branch name with git branch -m <branch name>
in the ./repo
directory.
I faced the same issue. it happens when the repo is initialized at master branch, but the config informs it to push on another (wiki in this case). I had to fetch and checkout to that branch manually. The fix would be having the code checkout to the specified branch on initialization.
HEY I KNOW How to fix this...
@NGPixel
You just have to change this line here:
index 0766d69..a331f25 100644
--- a/server/configure.js
+++ b/server/configure.js
@@ -243,7 +243,7 @@ module.exports = (port, spinner) => {
},
() => {
if (req.body.gitUseRemote === false) { return false }
- return exec.stdout('git', ['pull', 'origin', req.body.gitBranch], { cwd: gitDir }).then(result => {
+ return exec.stdout('git', ['pull', 'origin', req.body.gitBranch + ':' + req.body.gitBranch], { cwd: gitDir }).then(result => {
return 'Git Pull operation successful.'
})
}```
All you have to do is do a git pull origin branchname:branchname
The ':' will pull branch into branch.
And this *won't* break your existing master branch code.
I created a patch file to apply based on current dev
branch.
Here ya go:
0001-227-cannot-push-on-remote-branch-updating-server-set.patch.txt
Actual behavior
While using docker to test on my documentation repo I've got everything running on a branch called nsa-wikijs except the page edition When I edit a page from within the application, it edits ok in the app, but the code is not pushed back on the remote branch. I have this error :
btw it's working perfectly on master.
Expected behavior
The remote repo is updated on the changes done on the app.
Steps to reproduce the behavior
configure wikijs to a repo containing markdown documentation on a branch different than the master for example :
you can check my test repo here : https://github.com/savoisn/wikijs-test extract from my config.yml
docker-compose up http://localhost:3000/ login with the admin user make a change in the webapp and check the log you should see the error reported above.
p.s. I've just pull the new docker image as of today (2017-08-28) :)