I have the folder called, SpartanDrive-hansol, as you see in the picture, and it contains all the necessary files that I need. But just the folder, SpartanDrive-hansol, is unnecessary, and it causes a problem when I try to merge it with master branch because master branch does not have that folder.
Can anyone help me how to delete the unnecessary hierarchy of the folder? (But I need all the files that are in the folder) Thank you!
You can do it easily with the terminal. In the parent directory of the SpartanDrive-hansol folder, run the following command in the terminal:
mv SpartanDrive-hansol/* .
This will move all contents of the folder to your current folder, which in this case is the parent folder.
Related
Every time I open a new folder from my files, Source Control thinks it's a repository. For example:
https://i.stack.imgur.com/fs4Ir.png
These are all files I've created in VS Code, but it considers them "untracked"
If VS Code shows the source control tab, it's because it found a .git folder either in the folder you opened or any of the ancestor. It will looks for such folder recursively, up to the root.
This folder contains all the local git database stuff.
You should look inside your folder structure up to find such folder and remove it (it's probably an hidden folder, you should set your options accordingly).
Another way to find where's this folder is located is to open a command prompt, cd your folder and run git rev-parse --show-toplevel. This will output the repo root folder.
It seems a straightforward one, but having researched multiple ways to do it, I can't gitignore a folder within a directory.
I have a root directory which contains all of my code in it. Because it has some back-end NodeJS stuff in it, it has a 'node_modules' folder which contains hundreds of files. As a result, when I try to upload the entire parent folder, GitHub says there's too many files to upload and tells me to reduce the number I'm uploading.
The crucial part is though, the folder has to be uploaded as a whole, as it itself is within a GitHub repository with other files with different folders in.
That means when I go onto my repository, I need this folder's files to display within the folder, and not separately within the repository. I need all of the files to be within this folder, within the parent repository, excluding the node_modules folder.
For example ->
Parent repository -> Child Directory (what I'm uploading) -> Individual files
I've tried to add the node_modules folder to my gitignore through the following methods:
Adding: node_modules/ to my gitignore file
Writing: echo node_modules >> .gitignore through my terminal
Adding a separate gitignore file within my node_modules file with a * in it
None of them have worked and I can't find any other solutions. For reference I'm using a Mac.
Does anyone have any idea what I'm doing wrong, or how it'd be best to do it?
By default, you do not need to include the node_modules folder in your repositories because the package.json file contains all of your project's dependency information. This means that anyone who clones your repository can run npm install and have the entire node_modules folder without problems.
To solve this you can create your own .gitignore file, creating a new file at the root of your project and renaming it to .gitignore (writing exactly that way). Then you can open it with any text editor and add */node_modules to one of the lines.
This will likely solve your problem.
Im having two kind of node_modules in my folders.
One in the root folder, that works fine, but one also in the folder called "html/app" ( so would be html/app/node_modules )
Why wont it ignore it? it adds everything in the node_modules app folder when i do the command "git commit ".
Current .gitignore contains:
/dist
/tmp
/out-tsc
# dependencies
/node_modules
/html/app/node_modules
html/app/node_modules
If I understood your question right - you want to ignore both node_modules folders.
Try to cut that folder from project, then commit it and then return node_modules folder back.
Future commit's would ignore both folders.
EDIT: Probably it works in that way now because of that git already track that folder.
I have a project in Eclipse Oxygen that uses Git. When a file is created or edited it shows in the Unstaged Changes list on the Git Staging View. This allows you to drag the file to the Staged Changes list and then it can be committed.
I needed to create a folder named .sti directly under the project folder and then a folder named bin under that, like this:
project/.sti/bin
Then I had to create a file called assemble in the .stl/bin folder.
The problem is that the file called assemble does NOT show in the Unstaged Changes list. Therefore I cannot stage and commit it.
Is there any way of getting this file to appear?
I'm sure that the .sti folder is the cause of the problem.
Any ideas or help would be much appreciated...
In the end I deleted the .gitignore file in the project folder and recreated it. Upon refreshing the project in Project Explorer, the changed file appeared in the Unstaged Changes.
This was rather strange as the original .gitignore did not specify: .sti
A have copied a folder from one project, which is generated by system to another. Now I want to commit all stuff from the project, the folder was copied to.
What I get is (that copied folder is in folder /webapp):
org.tigris.subversion.javahl.ClientException: Attempted to lock an already-locked dir
svn: Working copy '/home/user/webshop/webshop-impl/src/main/webapp' locked
Ok, I tried to Team->Cleanup and got:
org.tigris.subversion.javahl.ClientException: Path is not a working copy directory
svn: '/home/user/webshop/webshop-impl/src/main/webapp/gwtmodules' is not a working copy directory
org.tigris.subversion.javahl.ClientException: Path is not a working copy directory
svn: '/home/user/webshop/webshop-impl/src/main/webapp/gwtmodules' is not a working copy directory
This eclipse SVN client is messing with me long time with this darn tigris exceptions =)
Please, help with advice :) What am I doing wrong?
This had me baffled as well when I got this error. This happens if we have some pending sessions on committing our changes so we’ll need to do some clean up before we’ll have another try on a commit.
This is the fix:
In STS or eclipse, right click on the offending project, click Team and then select Refresh/Cleanup. SVN gets the offending .lock files and deletes them. You can also do this from the command line.
You should delete .svn folders which contains repo info after you copy a directory to another place.
You are probably seeing it because the copied directory has some svn file which points to some place that does not match to the new location.
I would do an svn export from the first project. This will give you a clean copy of the code without any of the associated svn metadata. You can then add the exported code into the second repository.
It is very likely that your folder is lack of svn info(my case). To fix it, you can copy svn info from other folders, and then modify the snv file(all-wcpropc,entries) to the correct one.
I am not sure it is the recommended way, but it works for me!