看起来很简单,我正在阅读很多,但我有问题要做.
git add .
git commit -m "documentation improvements"
git push -u origin master
git push -u origin gh-pages
error: src refspec gh-pages does not match any.
error: failed to push some refs to 'https://github.com/danielfpedro/simple-modal
.git'
Run Code Online (Sandbox Code Playgroud)
我错过了什么?
这个文档可能有帮助.即:
cd ..
git clone https://github.com/danielfpedro/simple-modal.git simple-modal-webpage
Run Code Online (Sandbox Code Playgroud)
cd simple-modal-webpage
git checkout --orphan gh-pages
git rm -rf .
Run Code Online (Sandbox Code Playgroud)
echo "My GitHub Page" > index.html
git add index.html
git commit -a -m "First pages commit"
git push origin gh-pages
Run Code Online (Sandbox Code Playgroud)
推送到gh-pages
分支机构后,您的项目页面将在danielfpedro.github.io/simple-modal
simple-modal-webpage
)并gh-pages
在原始repo(simple-modal
)中拉出分支:cd ..
rm -r simple-modal-webpage
cd simple-modal
git fetch --all
git checkout -b gh-pages origin/gh-pages #New git just use --> git checkout gh-pages
Run Code Online (Sandbox Code Playgroud)
gh-pages
.用它来为github网页提交更改:git checkout gh-pages
<made changes to documentation>
git add .
git commit -m "documentation improvements"
git push -u origin gh-pages
Run Code Online (Sandbox Code Playgroud)