How to find missing file in my github submodule - github

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.

Related

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.

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'

what Git Ignore field means in github desktop while creating a new repository

see the Git Ignore option in the below image.What I have to choose, I am creating an ionic-framework repository.
https://i.stack.imgur.com/pBvkd.png
.gitignore is a file which, Git uses to determine which files and directories to ignore, before you make a commit. These files/directories will not be pushed into the repository.
If you have any files or directories that don't need to be pushed into the repository, then you can include them. (a simple example : log files)
If there is no ionic option, you can ignore it, and create it locally on your repo, then push it back to your GitHub repo.
To create it, see https://www.gitignore.io/api/ionic3
It does generate an Ionic .gitignore for you.

Why does eGit create an extra directory in the remote repo when I do the first commit/push?

Using eGit...
When I perform the initial Commit and Push from Eclipse, a new directory appears in the remote repo. Inside that directory is the root of the project directory. It makes a big mess because when someone clones it (again using eGit) the src folder is munged into a name containing then project folder name, which mucks up the package references in the class files.
eGit assumes you don't want an entire git repository for a single workspace project. Doing so would be wasteful and cumbersome for almost anything nontrivial. https://wiki.eclipse.org/EGit/User_Guide#Implications
You also didn't commit the .classpath file, which would have indicated what the source folders were.

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