Git restore files from HEAD and no content in the files - javascript

Good afternoon!
I have seemed to have done a mistake in git. I was trying to clone a repo so I could push a project code to the repo, but got an upstream error and did git pull which didn't work and I tried to revert back to my initial commit which deleted my files. I did get them recovered using git checkout HEAD [filename], but when I go to open the said file I get unable to open error on visual code studio, and there is no content.
I ran the git show command and it shows all of my files and their contents. I also ran the history command, but it doesn't show all of the commands I have made.
How do I recover the full file?

Turns out VScode was having an issue. Opened the project using sublime and all of the code is there.

Related

HTML, CSS and Vanilla JavaScript - "Welcome to Firebase Hosting" showing up on domain instead of website content

I'm working on an HTML, CSS and Vanilla JavaScript project on my iMac computer. I already linked my VS Code Project to Firebase successfully, and Firebase writes that the website is deployed.
However, no matter what I tried, I cannot get rid of this welcome page when I am looking up the domain on the browser:
This is what I have tried:
Clearing Safari browser history and cache.
Checking if the index.html file was overwritten, but I don't see any duplicate in VS Code. However, I did find the index.html "Firebase Welcome Page" if I searched the computer files, and I deleted all of those.
Going into Finder, and deleting the dist folder, and then re-installing firebase tools. Note: I don't have any visible dist folder in my VS code files either.
Going into package.json and adding "public": "dist/constructioncompany-master"
Deleted node_modules and tried to do firebase init again.
Tried npm build, and I get this error in the terminal:
Unknown command: "build" (I know that I need a script for this, but I don't know what it would be?)

react app published on github pages shows white screen

I have a React.js app, I built this simple meme generator app trying to learn web development (pretty new to the stuff) and am trying to host it using Github pages. I followed all the steps like installing the gh-pages with node and adding the url to the packages.json and adding the extra 2 lines of code for predeploy and deploy. I have the source for the github pages set to gh-pages. i get no errors when I run the command "npm run deploy" in terminal. But when I click the link I get a white screen. The console gives the error "Loading failed for the with source “https://z0onic.github.io/static/js/2.0b197680.chunk.js”. which is the first js file in the build directory. I searched pretty heavily and found other people who had a similar white screen issue but none of the answers helped. I have triple checked against these answers. Based on the error I'm getting I think its a build error but I don't know how to fix it or figure out exactly what is going wrong.
The github repository is at https://github.com/z0onic/meme-page and the link to the blank page that should be the hosted app is https://z0onic.github.io/meme-page/
when hosting locally through vs code with "npm start" command everything works fine.
Any help is appreciated I hope I'm not overlooking something silly but like I said I'm new to coding and still learning.
set the homepage in package.json to "https://<username>.github.io/<reponame>/" of course substituting things in <>

Is it possible to get a git tree like ls-files but remotely?

My goal is to get all the markdown files of a git Server and to display them as a kind of documentation platform for the project.
Is it possible to get a tree of all currently committed files of a git repository using command line?
Or is there any other possible option to get all markdown files including their path from a git repository?
(The main reason is a bonobo git server... if nothing else helps something platform specific is ok. But the goal is to make it work with every git)
(It would be even better if there is a JavaScript option to do that)

How napchart.com is constructed

I want to build a site similar to this one.
So I downloaded the source code from https://github.com/larskarbo/napchart on my Windows 10 machine, but I don't know how to execute the thing and see it running in a page so I can play with the code and see how it is working.
I have node.js installed but I am not sure of how to use it, so detailed instructions are welcomed
Also, I tried saving the code from the site directly by clicking Save As but it didn't work though. Why is that happening?
Considering napchart has been pushed to the npm registry, you shouldn't need to interact with its source code directly.
As per your second question, I don't advise to download any of it manually. Running npm install napchart --save in your project directory should get you going.
That being said, the author also published the source of https://napchart.com/app, which can help you bootstrap your project.

How do you get an angularJS w/typescript project to work on a website?

I'm really new to development in general, and I have recently followed through the angular 2.0 tutorial. What I'm wondering is how I would be able to host say the tutorial project online at github pages. I've tried uploading the project to my repository I created for the github page, but it doesn't seem to work.
You can upload and commit an existing file to a GitHub repository. Drag and drop a file to any directory in the file tree, or upload files from the repository's main page.
On GitHub, navigate to the main page of the repository.
Under your repository name, click Upload files.
Drag and drop the file or folder you'd like to upload to your repository onto the file tree.
At the bottom of the page, type a short, meaningful commit message that describes the change you made to the file.
Below the commit message fields, decide whether to add your commit to the current branch or to a new branch. If your current branch is master, you should choose to create a new branch for your commit and then create a pull request.
Click Commit changes.
Also recommend using Git Bash: https://git-scm.com/downloads
Here are the procedures for uploading with Git Bash: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/

Categories

Resources