How To Delete All Files Or Code From Github Repository

[Solved] How To Delete All Files Or Code From Github Repository | Shell - Code Explorer | yomemimo.com
Question : How to delete all files or code from github repository without deleting github repository itself?

Answered by : ahmad-mujtaba

git pull
git rm -r *
git commit
git push
Demonstration example:
git checkout <first commit hash>
git rm -r *
touch README
git add README
git commit --amend
git push -f

Source : | Last Update : Sat, 13 Aug 22

Question : how to delete all files github repo

Answered by : prince-muhammad

{"tags":[{"tag":"textarea","content":"# create a new repository that has the initial commit that you want\nmkdir foo; cd foo; git init; ...; git commit\n\n# set up a remote\ngit remote add origin <url-of-remote>\ngit branch --set-upstream master origin\/master\n\n# push your new history\ngit push -f\n\n# delete obsolete remote branches\ngit push origin :deprecated-branch","code_language":"shell"}]}

Source : https://stackoverflow.com/questions/4922104/is-it-possible-to-completely-empty-a-remote-git-repository | Last Update : Sun, 30 Apr 23

Question : how to delete all files github repo

Answered by : prince-muhammad

{"tags":[{"tag":"textarea","content":"mkdir reset\ncd reset\n git init\n touch README.md\n git add .\n git commit -m 'Initial commit'\n git remote add origin [email protected]:XXX\/xxx.git\n git push --force --set-upstream origin master","code_language":"shell"}]}

Source : https://stackoverflow.com/questions/4922104/is-it-possible-to-completely-empty-a-remote-git-repository | Last Update : Sun, 30 Apr 23

Question : how to delete all files github repo

Answered by : prince-muhammad

{"tags":[{"tag":"textarea","content":"mkdir git-remote\ncd git-remote\ngit init --bare\ncd ..\nmkdir git-local\ncd git-local\ngit clone ..\/git-remote .\ntouch a\ngit add a\ngit commit -m \"initial\"\ngit push origin master","code_language":"whatever"}]}

Source : https://stackoverflow.com/questions/4922104/is-it-possible-to-completely-empty-a-remote-git-repository | Last Update : Sun, 30 Apr 23

Answers related to how to delete all files or code from github repository without deleting github repository itself

Code Explorer Popular Question For Shell