Github makes a repo of documents folder - github

My Github decided to make a repo of my whole "Documents" folder. Is there a way to disable it, because it's really annoying when working with that folder?

Delete the .git folder within Documents to remove the Git repository.

Related

Github desktop caches deleted local repository

I'm new at GitHub and I'm having this issue: I created three private repositories for my project, all fine. On the fourth one, for some reason GitHub desktop included the node_modules folder (its an angular cli app), so I deleted the repository from GitHub.com and from GitHub desktop. When I try to recreate it, it is "cached" on my Mac, even if I copy everything to another folder, and it tries to upload the node_module files.
I also changed the name of the repository, copied all the files but node_modules folder to another folder. Same happens over and over.
I couldn't find anything on internet about this. Sorry if its a newbie question.
You could try to delete the git folder that it's being hidden by default.
Go to in file explore -Views- select "Hidden Items" and try to remove the git folder from here. After that set up your .gitignore file and pass node_modules before you use git init
Use this in your terminal, if you are using VS Code use this in the same folder you are having the problem : git config --global core.excludesfile '~/.gitignore'

How to transfer files out of a Github repository?

I don't know how to "disable" github off my code, because I tried to move them out of a folder, but they still have github changes, and other github related stuff. I want to make them just simple files on a computer (html, css, js), with no Github.
Just remove the folder .git in the top folder, and it wont track git anymore.
rm -rf .git

How to make subfolders repository in Github

I've been using this folder structure where I would have one main .git folder and then have subfolders inside which doesn't have .git folder.
So as example :
Main Folder
Subfolder
Subfolder
Subfolder
Now what I want to do is, I would like to extract some of those subfolders and make them separate repositories with their histories. Which means subfolders will become a main folder as a repository. Any idea how?
The official documentation use git filter-branch.
But that or BFG are obsolete.
Use the new tool git filter-repo (directly in your regular local repository, although a backup is always a good idea before those kind of filtering)
Use a path shorcut:
git filter-repo --subdirectory-filter Subfolder1
Only look at history that touches the given subdirectory and treat that directory as the project root.
Equivalent to using --path / --path-rename /:

Will deleting a local git repo affect the remote repo?

I did a git clone to my computer. After that I realized that I cloned the project to wrong directory. What I want to do now is delete the project folder from my computer and do a git clone to another directory.
If I just delete the folder, will it affect the remote repository?
Any other better way to do?
You can just move the directory to where you actually want it. Moving it, or deleting it, will not impact the remote repository.
You can delete the folder locally and clone it again to the directory you want to work in. Nothing will effect the remote repository. You also can just move the folder since there is no absolute path in the .git structure.

Trying to understand how Git works

I just installed eGit plugin and I'm playing around with it. I'm new to Git.
I've noticed something strange:
I committed sample project "Planets" then I modified one file only Planet.java.
Then I looked in the Git repository folder, and this modified file Planet.java is there, but none of my other source files are.
Does this mean if I delete my original project folder from the disk, it will break Git? I mean will I not be able to restore any previous committed version of this project anymore?
The "original project folder" is your Git repository. Git only exists* within the directory where you performed a git init. Its metadata about your files is stored within a hidden .git directory inside your project directory. If you delete your project directory, you're deleting your local copy of the Git repository.
*Assuming you haven't explicitly cloned your repository