Git Question: Update gh-pages branch and from master branch

Hello I’m making Markdown-Previewer one of the project in Front End Development Libraries. I finished it, I put it on the github https://github.com/lorenzoSpec/markdown-previewer/tree/master. But when I’m adding some code. Commit it to master branch not knowing I need to update the gh-pages branch because that is the one which renders the app live.

I try different guides

Then now I have new react app and new repository. (Before I delete the previous react app I secure first the code in App.js). Now It is new I put the react app again in new repository. I try again to update the gh-pages branch from master branch. But still it does not work.

What should I do?

I’m thinking about simple solution. I can remake and make new repository. Then ready the finished markdown-previewer app, put it on github. Just one initialized and not having problem to updating different branches. But I think that is not the way to do it if I have my own application making and having commits in different time in diffrent date.

here is my terminal in VS Code. You can see the error here.

PS C:\Users\lorenzo\OneDrive\Documents\Web Development\2021\markdown-previewer> git add .
warning: LF will be replaced by CRLF in src/App.js.
The file will have its original line endings in your working directory
PS C:\Users\lorenzo\OneDrive\Documents\Web Development\2021\markdown-previewer> git status
On branch master
Changes to be committed:
(use “git restore --staged …” to unstage)
modified: package.json
modified: src/App.css
modified: src/App.js

[master 0f7b927] app.js
4 files changed, 320 insertions(+), 64 deletions(-)
rewrite src/App.css (100%)
rewrite src/App.js (99%)
PS C:\Users\lorenzo\OneDrive\Documents\Web Development\2021\markdown-previewer> git push origin master
Enumerating objects: 29, done.
Counting objects: 100% (29/29), done.
Delta compression using up to 4 threads
Compressing objects: 100% (28/28), done.
Writing objects: 100% (29/29), 192.18 KiB | 4.47 MiB/s, done.
Total 29 (delta 4), reused 0 (delta 0), pack-reused 0
remote: Resolving deltas: 100% (4/4), done.
remote:
remote: https://github.com/lorenzoSpec/markdown-previewer/pull/new/master
To https://github.com/lorenzoSpec/markdown-previewer.git
PS C:\Users\lorenzo\OneDrive\Documents\Web Development\2021\markdown-previewer> git checkout gh-pages
error: pathspec ‘gh-pages’ did not match any file(s) known to git
Current branch master is up to date.
error: src refspec gh-pages does not match any
error: failed to push some refs to ‘https://github.com/lorenzoSpec/markdown-previewer.git
PS C:\Users\lorenzo\OneDrive\Documents\Web Development\2021\markdown-previewer> git merge master
Already up to date.
PS C:\Users\lorenzo\OneDrive\Documents\Web Development\2021\markdown-previewer> git push origin gh-pages
error: src refspec gh-pages does not match any
error: failed to push some refs to ‘https://github.com/lorenzoSpec/markdown-previewer.git
PS C:\Users\lorenzo\OneDrive\Documents\Web Development\2021\markdown-previewer>

here is the screen shot

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.