Github desktop caches deleted local repository - github

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'

Related

Why is Github desktop creating a new folder rather than using the one I specified when creating a new local repo?

I am looking to do something I thought was pretty simple... I have an existing folder (with project files) on my desktop that I would like have tracked by Github desktop for purposes of source/version control. It seems straightforward... I go to github desktop, select that I'd like to create a new repository, and point it at the folder on the desktop. Here is what I expect to happen:
Desktop
Project folder
Project files
(hidden) .git folder
(hidden) .gitattributes
Instead, this is what I get:
Desktop
Project folder
Project files
New folder with specified git repo name
(hidden) .git folder
(hidden) .gitattributes
I am not sure why this is happening and it is very frustrating. It looks to me like I have only two options here:
Cut and paste Project files into New folder with specified git repo name
Cut and paste .git folder and .gitattributes out of New folder with specified git repo name and into Project folder, delete New folder with specified git repo name, remove the new repo in Github Desktop when it says it can't find it, and "Add Existing repo" in Github Desktop and point it at Project folder.
Both of these approaches sort of feel like hacks and I am not sure what consequences, if any, may negatively impact my version control intention as a result. Is this a common problem? What should I do?
I wouldn't use github desktop to make your repository. If you don't have it already try installing git bash, a command line interface, and initialize git from there.
Find your existing folder and move to it using cd <folder name here> if you go into the wrong place use cd .. to move out/back one folder
When in your folder use git init to initialize git(the version control software)
Open GitHub Desktop once again and hit "add" then "add existing repository" finally "choose" and find your file in your file explorer
When you go to "Create a new repository":
Name: New folder with specified git repo name
Local Path: Desktop (ie one level up from Project files)
This will create the .git and .gitattributes in your existing folder without affecting the other files.
The Create a new repository dialogue seems to assume the name should be used as a new folder under the path you specify.
Note that if there are spaces in your name, it tries to replace them with hyphens.

How to upload foders using Github desktop

I'm very new to Github and I'm trying to create a new repository that contains 2 folders ("server" and "utalk").
The "utalk" folder is my front-end and the "server" folder is my backend.
But when I use Github Desktop, it seems I only push the server folder and cant push the utalk folder.
I don't know how to push all my folders.
my Project Folder:
my GitHub repository:
First, in your file explorer, enable View hidden files
Then check if you see a .git in the utalk folder. That would make it a nested git repository, mostly ignored by your parent folder.
Switch to command-line and do a git status in utalk-project to know more about your current situation.

How to find missing file in my github submodule

I am new to git, so I used git to put my ionic project folder into local repository then push it, it did not appear as the normal repository I saw.
It then becomes submodule, so I cloned the repository, then the folder became empty, then I could not find my file but a empty folder.
Can someone tell me how to find my missing file and why I tried to push a simple folder then it becomes submodule?
put my ionic project folder into local repository then push it, it didn't appear as the normal repository I saw , It becomes submodule
That is because your ionic project folder already included its own .git/ subfolder.
Once copied into your local repo (which also has its own .git/ subfolder), the ionic project folder is considered as a nested repository, and only a gitlink (reference to the root tree SHA1 of ionic/) is recorded and pushed by your local repository.
Hence the "submodule-like" empty folder on the remote side.
If you don't care about the history of that project, you could simply copy its files into your local repo, add, commit and push.

Publishing to github results in an empty repository

I am new to git. I downloaded the desktop version (for Windows). I dragged the folder containing my project into the big window, "Get started by adding a repository." All the files showed up in the left window. Then I clicked on "Publish Repository". It then shows 143 files have changed, with 0 unsynced.
But when I go to my account on the git website, the repository is empty. The only files in it are .gitattributes and .gitignore. The whole idea here is that I want to share this project with other people.
Help out a git newbie and explain how I get the entire solution into git?
Thanks!
As you already have the remote repository at GitHub, you should use the clone option first to clone your repository locally.
This will create a folder (your repository clone) on the default location containing those two files.
Then you can copy your project files to this folder and try to sync again.

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