I had a local directory structure on my machine thus:
c:\myprojects\project1\
and
c:\myprojects\project2\
Both directories had multiple files within themselves respectively.
On github, I created a repository named myprojects
under root with username, say, Tryer
. So, if I navigate to https://github.com/Tryer?tab=repositories
, I am able to see just 1 repository of mine named myprojects
. So far, so good.
Then, I issued the following commands to replicate the local directory structure on github.
Navigate to c:\myprojects\ on my local machine. Open command prompt.
git init
git add c:\myprojects\project1
git commit -m "firstcommit"
git branch -M master
git remote add origin https://github.com/Tryer/myprojects.git
git push -u origin master
This then replicated the c:\myprojects\project1\
folder online. Then, for c:\myprojects\project2\
, I did:
git add c:\myprojects\project2
git commit -m "project2commit"
git branch -M master
git push -u origin master
Now, I wanted to completely remove any online references to c:\myprojects\project2
since there was a bug in the code. I wanted to maintain the local directory where I would continue work on project2
and upload it to github only after fixing the bug. project1
is fine and should remain online.
To do this, I issued:
git rm -r --cached c:\myprojects\project2
git commit -m "Removed buggy project2"
git push origin master
Now, while this did "remove" project2
in that when I navigate to https://github.com/Tryer/myprojects
, I only see project1
listed, nevertheless, next to project1
, there is a link to a page with text Removed buggy project2
(the most recent descriptive name of the commit) which tells me what this commit was about. Here, it provides in full detail what exactly changed in project2
with a link to a diff between the at-present nonexistent files under project2
and what they were in the previous buggy commit.
So, project2
still continues to be "available" online, occupying space, etc.
Is there a way that even this data is removed from online github?