Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

【BUG】 Failed during deploy if the branch of github in config is "master" #426

Closed
leiqzhang opened this issue Jan 9, 2014 · 0 comments
Labels
bug Something isn't working

Comments

@leiqzhang
Copy link

If the "branch" name in config file is "master", then when deploy the project, an error message as follows will display before pushing posts to github successfully:

fatal: Cannot force update the current branch.

The bug exists in file lib/plugins/deployer/github.js:

var commands = [
          ['init'],
          ['add', '-A', '.'],
          ['commit', '-m', 'First commit'],
          ['branch', '-M', branch],
          ['remote', 'add', 'github', url]
        ];

Hexo deploy will run the commands above one by one. If the "branch" variable in the fourth command is "master", then the git command really run is:

git branch -M master

But the current branch is master already, so the message mentioned begin will be thrown and abort the deploy process.

tommy351 added a commit that referenced this issue Jan 11, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants