记不住的命令行们

2018-02-22  本文已影响69人  李佳芮_chatbot

一直在更新

查看占用3000端口的进程

lsof -i :3000

Sync fork repo B_REPOSITORY with upstream repo A_REPOSITORY

  1. clone repo B_REPOSITORY to local
git clone B_REPOSITORY_URL
  1. Add A_REPOSITORY as remote to local B_REPOSITORY(mostly called upstream)
git remote add upstream https://github.com/be-forked-repo.git
  1. pull A_REPOSITORY remote(upstream)branch(like master)
git pull upstream master
  1. puah to github B_REPOSITORY
git push origin master

Add all update file

git add -u 

Show log

git log

Delete no related commit

git reset -- hard <commit_id>
git push origin HEAD --force

If you didn't publish changes, to remove latest commit, you can do

$ git reset --hard HEAD^

(note that this would also remove all uncommitted changes; use with care).

If you already published to-be-deleted commit, use git revert

$ git revert HEAD

Delete branch

git branch -D testing

https://github.com/geeeeeeeeek/git-recipes/wiki/5.2-%E4%BB%A3%E7%A0%81%E5%9B%9E%E6%BB%9A%EF%BC%9AReset%E3%80%81Checkout%E3%80%81Revert-%E7%9A%84%E9%80%89%E6%8B%A9

上一篇 下一篇

猜你喜欢

热点阅读