Why can I not open my folder in GitHub? It has already been asked but i could not find the right solution for me. Here is the link for the same problem: Why can I not open my folder in GitHub?. Can anyone help me to get rid of it. Thanks in advance
That is because ngApp is itself a git repo (that folder included a .git subfolder in it)
So when you git add . in your repo, it just recorded ngApp as a gitlink (a SHA1 reference to the repo) without any URL (as opposed to a submodule, where a .gitmodules would include the url of the remote repo).
When you clone your repo back, that is all you get: a reference without URL.
If karanpepi/mean-stack-crud is supposed to include ngApp folder, go back to your local repo (where you have the ngApp folder) and delete the .git
cd /path/to/local/repo
git rm ngApp
git commit -m "remove gitlink"
rm -Rf ngApp/.git
git add ngApp
git commit -m "Add ngApp content"
git push
Related
I'm a beginner to using github and I accidentally added this folder to my github but I cannot find a way to remove this please help.
I tried deleting this folder from my main folder and redoing my git pull and push and in the terminal it said that this file as already been removed. But once I pushed my file again the files that needed to be updated were updated but the folder is still on my github repo.
Try:
git rm -r <folder>
git commit -m "remove folder"
git push
The changes will only be saved when you run the commit command
Below steps i followed,
Git init
git add .
git commit -m "First Commit"
git push origin master
what am I doing wrong to resolve the problem?
Go to the frontend folder and get rid of the .git file since you have another.git file in the root folder.
In Github, i have already a repository, e.g. called "java8"
And under it, i would like to have a sub-folder, e.g. called "01-lambda"
So my folder structure in github should be
java8
01-lambda
02-enums
etc.
Then I want to commit my code to the sub-folder "01-lambda"
How can I do that?
What I tried:
I just created a new folder with a txt file "01-lambda" under the repository "java8", then I tried to commit, but git bash shows they cannot find the sub-file.
I just commit my code directly to repository "java8", but then I need to change path of every files, and add /01-lambda in the path
git init
git add *
git commit -m “my first repo”
git remote add github .git
git remote -v
git push -f github master
I just created a new folder with a txt file "01-lambda" under the repository "java8", then i tried to commit, but git bash shows they cannot find the sub-file.
You need to add before committing, assuming you do have a file inside the new folder (Git would not add just a folder):
git add 01-lambda
git commit -m "add 01-lambda"
I created a github new repository first in github webpage and then I opened Git Bash to upload folders to this repository. I first used $cd f: and $ git clone git#github.com:username/project name.git to create a folder(with a initial .git folder and a README file in it) in f disk. Then, I used $cd f:\project name to switch to the current folder. After that, I copied all my project folders to my project name folder in f disk. Finally, I used the following four lines to upload all my project folders to github:
$git add .
$git remote rm origin
$git remote add origin git#github.com:username/project name.git
$git push -u origin master
After I entered the passphrase, Git Bash just showed everything up-to-date. But I refreshed my github repository page, there is nothing but the initial README file. Could someone tell me what the matter is?
You didn't commit after your git add.
git commit -m "first commit"
That is why git considered there was nothing to push: you HEAD was still the same than your remote origin cloned repo.
See Git Basics:
Your git add updating the staging area (index), but only a git commit will update your git directory.
I have a website I'm developing, it's github is https://github.com/samclark2015/Project-Emerald. I have the repo under my user folder in a subdirectory. Now when I push the site to github, it updates the tree as Sites/Project Emerald/... I need the contents of the project emerald folder in the root of my github repo. How can I change the root of my repo on my PC?
Since you just did your first commit in your GitHub repo, the easiest way would be to:
delete your local .git directory you have under 'Site'
recreate your repo locally, and force push it:
That would give:
# in Site/Project-Emerald
git init .
git add remote origin https://samclark2015#github.com/samclark2015/Project-Emerald.git
git add .
git commit -m "first commit, again"
git push -force origin master
You would then see in your GitHub repo directly:
PHP
SpryAssets
pictures
README
config.inc
...
Other alternatives are mentioned in "My Git repository is in the wrong root directory. Can I move it? (../ instead of ./)"