git 命令行提交
I know just enough git to be dangerous. I'm not doing advanced bisecting but I can stash, rebase, and reset with the best of them. One new trick I learned from , Luke Crouch, saves me loads of time: getting the commit ID via command line. For years I would merge a PR, go the project's main page, and copy the commit ID so that I could push code to staging and production. Always seemed like an extra step rather than just making it happen from the terminal. Here's the magical command:
我知道git够危险。 我没有进行高级二等分,但是我可以利用它们中的最好的东西进行存储,变基和重置。 我从卢克·克劳奇(Luke Crouch)那里学到的一个新技巧为节省了很多时间:通过命令行获取提交ID。 多年来,我会合并PR,转到项目的主页,然后复制提交ID,以便将代码推送到暂存和生产环境。 似乎总是一个额外的步骤,而不仅仅是在终端上实现它。 这是神奇的命令:
git rev-parse HEAD
Of course you need to update your local repo to remote master, but you do that anyway, right? Hopefully this will become a timesaver the same way it has for me!
当然,您需要将本地存储库更新为远程主数据库,但是您还是要这样做,对吗? 希望这对我来说将成为一种节省时间的方式!
翻译自:
git 命令行提交