I am very new to working with Git and GitBash.
I have a repo on GitHub called “RepoA” which already has some files (let’s say files from FolderA). I uploaded these on there using add, commit and push in GitBash. Due to some issues I had to delete the “.git” folder in FolderA and now I’m trying to create another “.git” folder in it but the issue is that GitBash is not detecting the already uploaded files. I’m assuming I have to git clone the repo (?) because I read some answers about that. But the issue with that is my branch name “main” (which I actually want to push to; part of RepoA) is appearing as “master” and hence I cannot commit or push anything or there.
My main questions are:
- How can I make it so, so that the files in RepoA are tracked by the “.git” folder?
- How can I add files from FolderA to my “main” branch in RepoA?
I realize that manually uploading is possible too but I’d really like to experiment using GitBash or even CMD commands.
I tried initializing .git again but again, that resulted in all the files being untracked and me having to manually commit and push again.
I have tried git clone of RepoA but all that does is copy the files from RepoA into my Folder A.
Rin R is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.