I am working on a project that uses both React and Springboot apps, so I have individual folders for each of those and am trying to get them both into my github repo. I was easily able to drag and drop the springboot folder, but my react one does not upload at all when I drag it into the upload box. Is there an easy terminal command in vs code (the editor I'm using) to add the entire folder?
Since you want to add your 2 different projects in 1 repository, you can firstly put both of your project folder inside 1 main folder, example:
MyFolder:
- MyReactProject
- MySpringbootProject
here MyFolder is your main folder, which has both of your projects, react and springboot.
then finally make a file inside MyFolder with name .gitignore, and put this line inside that file:
**/node_modules
what this file will do, is when you will push your code to github, it will ignore all the files and folders which are listed inside .gitignore file.
You Don't Need node_modules folder
when uploading your code somewhere online, you don't need to upload the node_modules folder, because this folder contains all the dependencies your project need, but when uploading your code online people can download those dependencies by calling the command npm install which will read all the modules needed from your package.json file, and download it on your machine.
To upload your code online you first have to authorize yourself on your local git program, to authorize yourself for github you can read this Article.
After authorizing yourself, firstly make a new empty github repository, by going to github or just by clicking this Link, after making a github repository open Terminal/Command Prompt in your Folder where both of your projects were, in this context my both projects were in MyFolder.
After opening Terminal/Command Prompt enter this commands:
git init
git branch -M main
git add .
git commit "Added all the files"
After running these commands, finally run these 2 final commands:
git remote add origin https://github.com/username/repository-name.git
here, replace username with your github username, and replace repository-name with the name of your repository you specified while make a new repository.
and finally run this command
git push -u origin main
and your code should be pushed on github.
If you don't want to use git commands you can also use, Github Desktop, but it is recommended you first learn basics of git and then use github desktop
I have been running into this error "Could not find a required file. Name: index.html" when I attempt to deploy my React Portfolio to Heroku. I have looked at previous answers and I have not found a solution. I do not have my public folder in .gitignore and I will attach a photo to show.
Do I need to add certain "scripts" in my package.json that I may be missing. I also tried buildpacks after watching a youtube tutorial and that did not seem to work either.
If you're deploying from Git, anything gitignored will not be included in what gets deployed. Rather than ignoring the whole public directory, you could ignore only some files, for example public/*.js.
EDIT: see comments, I misread the question.
The solution to this was that I did not have all my files at the route. Simple as that, I just needed to delete the parent folder and move all files to the route of the directory. I had them nested within 2 folders, I had moved them out of one of those folders thinking it was at the route but it needed to go one more folder out and that was the issue that I was having.
I'm writing a React project in VS code. I met this problem in VS code. In my project, this folder shows Contains emphasized items and I know it means there is an error in my files. But in the picture:
,
I have checked all files but no error was found. So this makes me feel confused.
I have searched this problem on google and found a similar GitHub issue. https://github.com/Microsoft/vscode/issues/54960
Use the command, CTRL+SHIFT+P on windows or COMMAND+SHIFT+P on mac, then search "Developer: reload window", click on it, your vs will reload and enjoy your stress-free coding.
Committing once with git can be resolved.
I can solve the problem react-native start --reset-cache and by reloading VS with the command Ctrl + shift + p and searching Developer: Reload Window
Just to know I was in an Angular project, using Windows, WSL, I created a service and after that I renamed it, when I committed the changes, I noticed this red mark.
I just pressed
Ctrl + Shift + P and then typed: Developer: Reload Window. It will just reload the entire project and the mark will disappear.
I saw this message after moving a file from one folder to another, renaming and committing everything to git.
The Visual Studio "Problems" window showed an issue with the "deleted" file. Somehow VS had left a window open for the original location of the file and in it's tab the file was labeled as "deleted". Closing that tab in VS got rid of the "Contains emphasized items"
This error is coming because sometimes we delete something so its need window reloading and to reload Type the command, CTRL+SHIFT+P on windows or COMMAND+SHIFT+P on mac, then search "Developer: reload window", click on it. It will reload the window and your error will be gone
This happens when you've deleted some files/folders from project and haven't yet added the event to a commit.
There is multiple solutions
Option 1: Close the VS code and open it again
Option 2: Commit your code chages in git(if you are using)
Option 3: Reload the VS code - Use the command, CTRL+SHIFT+P on windows or COMMAND+SHIFT+P on mac, then search "Developer: reload window", click on it
Had the same issue.
Committing multiple times from within the VS Code did not help.
However, once I added the files and committed from the shell, everything fell in place.
I noticed this when I working on a Rails application using Visual Studio Code editor.
I used an underscore for a directory name, that is instead of staticpages, I named the directory static_pages.
However, committing the code change using the below commands fixed it:
git add .
git commit -m "commit message"
That's all.
I hope this helps
In my case, the already deleted files were opened in the VS code. Closing those files resolved my issue.
This is an edge case but I am putting it here just in case it helps someone in the future...
I had accidentally done a git add . before I had fully set up my .gitignore file, so it had staged a couple folders with hundreds of files (mostly the entire Electron out folder) that I definitely didn't want in the repo.
This is the procedure I went thru to clean up my staged files:
updated .gitignore so that when I reverted the add I could be sure that GIT was ignoring the right files and folders (which worked, hundreds to 7, the moment I did the git reset)
git reset -f
noting that the correct files were now in line to be staged, I did:
git add .
git commit -m "message"
git push
When I returned to the regular file list, I noticed that node_modules was showing the "emphasized items" indicator. So just to make sure that I had actually gotten everything committed and such I tweaked .gitignore again (added node_modules/** just in case lol), did another commit, and still had the issue. Nothing helped, and like I said, it was confusing because the indicated files were under node_modules and it was in the ignore list.
So I hit cmd-p and ran Developer: Reload Window. It turned out out all I had to do was reload the window and the emphasized items went away entirely. Simple fix, confusing problem.
Apparently adding, reverting, then adding a subset of my directories confused vs code and it just needed to reload the window.
I had the same issue, pushing to git didn't solve the problem. I simply closed all files, cancelled my dev server and restarted VS Code. The emphasizing was gone.
this work for me :
I can solve the problem react-native start --reset-cache and by reloading VS with the command Ctrl + shift + p and searching Developer: Reload Window
In my case files that had been deleted were still opened in VsCode. After closing them (and also git commit as other posts suggest) helped solved the problem
git add .
git commit -m "your commit description"
If this not helps, after commit restart the VS CODE
Select this tab from toolbar - View -> Problems or Ctrl + Shift + M and on bottom Terminal you will see whats problem is it.
0
When I was working on a angular application in the Visual Studio Code editor, I observed this. And resolved it by simply restarting VSCode.
This error occurs because there are pending changes to be saved in git, so to solve this problem, open a command terminal and go to the folder where your project is located, execute the following commands
git add .
git commit -m "your commit description"
In my case it works with this.
VSCode using React. Changed a folder name in the src folder. Would not pass compilation after changing names of components. Committed to git. Restarted the app with npm start. All is well.
You may have hidden files. My Explorer was not listing hidden files in those directories. Hidden files on Linux begin with a . (for example, .hidden.txt)
Had the same issue, had copied files from a folder into another folder. git commit as suggested solved the issue.
commit the changes, if still, the error is there, reopen the vscode
I don't think so we need to involve git for this issue.
Just restart the vs-code and things will work like a rocket🚀
uninstall any extension if you have installed in vs code.It will be solved.
I installed SQLite into my WPF project via Nuget. Then added the entire project to a remote repo. Then I cloned the project on another machine, and had a broken build.
x64\SQLite.Interop.dll was missing.
I'm puzzled why Git didn't include one file from my project. I checked the repo on BitBucket and confirmed it is not there. Git status reports nothing to commit, working directory clean
It added the x86 version, but not the x64 version, I can't imagine why.
(project)\x64\SQLite.Interop.dll Git ignored this file!
(project)\x86\SQLite.Interop.dll
You might want to check the .gitignore file at the root of the repo. If it contains for example x64, it would ignore this file.
There would be two main possibilities then:
edit this file to fit your need
or force this file to be added; ie: git add -f x64/SQLite.Interop.dll
However, committing binary files is often frowned upon. It's true in particular if you want to keep up to date with the latest package, hence if you plan to commit new versions of the dlls on a regular basis.
You might rather want to consider Nuget package restore feature. Basically the idea is that you commit a config file, and the client will automatically download the corresponding packages.
I have recently started using GitHub. I am uploading my cakephp website.
Also, I am using GitHUb for windows, http://windows.github.com/
Now, after I added my CakePHP files -> committed the changes -> synced, I do not see my app/database.php file being uploaded.
I checked the repository through browser, but still can't find the database.php file.
I have re-installed GitHub for windows, created a new repository, again added the files to it, but same result.
Please help, what is the issue.
Clear your .gitignore file and commit again.
But database.php is in your .gitignore is for a security reason. It may contain sensitive data, double check it before pushing.