博文

目前显示的是标签为“github”的博文

delete files in the github repositories

Step 1: Clone github repository        git clone repositoryURL Step 2: Switch branch        git checkout -b <branch> --track <remote>/<branch>       To view <remote>/<branch> use command:  git branch -r Step 3: Delete the files Step 4: Add the files       git add . Step 5: Stage the code        git commit -m "some comments here" Step 4: push to github repository        git push origin local_branch       git push origin master

revert a github commit

Use git revert to revert the commits Step 1: Clone github repository       git clone repositoryURL Step 2: Switch branch       git checkout -b <branch> --track <remote>/<branch>       To view <remote>/<branch> use command: git branch -r Step 3: revert the command       git revert HEAD       git revert HEAD~3       git revert commit_id Step 4: push to github repository       git push origin local_branch       git push origin master Find a ref that matches master in the source repository (most likely, it would find refs/heads/master), and update the same ref (e.g. refs/heads/master) in origin repository with it. If master did not exist remotely, it would be created.     use git remote -v to view the value of origin