git 摘取两个版本差异文件 获取增量更新包

受疫情影响在家总结前段时间的一些心得
每当改动调整了一些小bug或者小需求需要上传代码的时候,往往是不需要全量代码覆盖更新的,只需要摘出改动的文件即可。

版本控制工具导出增量更新包

查看版本记录log,选定指定某几个版本后点击导出即可

git diff eec76087115e3684c79410f7e3dab2a450e56d0b 9b75d2919c662bc846880c331003f4bf4b894ced --name-only | xargs -i cp '{}' ./update/ --parents

解释:通过xargs 命令,把git diff eec76087115e3684c79410f7e3dab2a450e56d0b 9b75d2919c662bc846880c331003f4bf4b894ced --name-only找到的所有文件名,作为参数传到给cp的第一个参数('{}'),并保留目录结构(--parents)拷贝到当前目录(./)的update文件夹中

增量更新代码

通过上述方法得到增量更新包后,上传到服务器,选择覆盖替换改动到的文件即可完成增量更新。避免了一些小改动把所有的代码文件重新上传一遍,大大提到了工作效率。

Responses
  1. It's the best time to make some plans for the future and it's time to be happy. I have read this post and if I could I want to suggest you few interesting things or suggestions. Perhaps you could write next articles referring to this article. I wish to read even more things about it!

    Reply
  2. Today, while I was at work, my cousin stole my apple ipad and tested to see if it can survive a 25 foot drop, just so she can be a youtube sensation. My iPad is now broken and she has 83 views. I know this is entirely off topic but I had to share it with someone!

    Reply
  3. Hi colleagues, how is everything, and what you desire to say concerning this post, in my view its really remarkable in support of me.

    Reply
  4. That is very interesting, You are an excessively skilled blogger. I've joined your feed and stay up for in the hunt for more of your wonderful post. Additionally, I've shared your website in my social networks

    Reply
  5. Hi would you mind stating which blog platform you're working with? I'm going to start my own blog in the near future but I'm having a difficult time deciding between BlogEngine/Wordpress/B2evolution and Drupal. The reason I ask is because your design seems different then most blogs and I'm looking for something unique. P.S Apologies for being off-topic but I had to ask!

    Reply
  6. I’m not that much of a internet reader to be honest but your blogs really nice, keep it up! I'll go ahead and bookmark your site to come back later. All the best

    Reply