Deleting a file from Github Repository




[root@manager gitrepo]# git rm --cached GettingStarted
rm 'GettingStarted' #this command will delete the file from repo and not from your directory.
#if you want delete the file from your directory too, please use git rm <filename>

[root@manager gitrepo]# git commit -m "deleting GettingStarted file"
[master a4fde93] deleting GettingStarted file
 1 file changed, 1244 deletions(-)
 delete mode 100644 GettingStarted

[root@manager gitrepo]# git push origin master
Username for 'https://github.com': shaan2212
Password for 'https://shaan2212@github.com':
Counting objects: 3, done.
Compressing objects: 100% (2/2), done.
Writing objects: 100% (2/2), 250 bytes | 0 bytes/s, done.
Total 2 (delta 1), reused 0 (delta 0)
remote: Resolving deltas: 100% (1/1), completed with 1 local object.
To https://github.com/shaan2212/learningdocker.git
   d68f2ba..a4fde93  master -> master

[root@manager gitrepo]# git status
# On branch master
nothing to commit, working directory clean
[root@manager gitrepo]#








No comments:

Post a Comment

Installation of Jenkins on Linux and Deployment NGINX through Jenkins

Installation of Jenkins: [root@worker1 ~]# useradd -c "jenkins user" jenkins [root@worker1 ~]# passwd jenkins Changing passw...