记录一些 Git 操作

Show a list of the files that are being tracked?

If you want to list all the files currently being tracked under the branch master, you could use this command:

git ls-tree -r master --name-only

Force checkout on remote branches

remote server name: origin
remote branch name: master

git checkout -f origin/master

Force “git push” to overwrite remote files

git push -f <remote> <branch>

不过还是尽量保持 git 推送关系简单的好,像只是为了摸索、测试下函数功能就不需要放在 Git 的 repo 里了,这些改动都是和版本无关的无关改动,而且 一旦 AWS、学校 Server、MAC 上都编辑,很容易乱掉。


如果您觉得我的文章对您有所帮助,不妨小额捐助一下,您的鼓励是我长期坚持的一大动力。

Alipay_Middle Wechat_Middle