月度归档:2019年02月

git add -A 和 git add . 的区别

Ps:原文时间 2016-09-10 13:30

实践

git add -Agit add .git add -u在功能上看似很相近,但还是存在一点差别

  • git add .:他会监控工作区的状态树,使用它会把工作时的所有变化提交到暂存区,包括文件内容修改(modified)以及新文件(new),但不包括被删除的文件。
  • git add -u:他仅监控已经被add的文件(即tracked file),他会将被修改的文件提交到暂存区。add -u 不会提交新文件(untracked file)。(git add --update的缩写)
  • git add -A:是上面两个功能的合集(git add --all的缩写)

下面是具体操作例子,方便更好的理解(Git version 1.x):

git init
echo Change me > change-me
echo Delete me > delete-me
git add change-me delete-me
git commit -m initial

echo OK >> change-me
rm delete-me
echo Add me > add-me

git status
# Changed but not updated:
#   modified:   change-me
#   deleted:    delete-me
# Untracked files:
#   add-me

git add .
git status

# Changes to be committed:
#   new file:   add-me
#   modified:   change-me
# Changed but not updated:
#   deleted:    delete-me

git reset

git add -u
git status

# Changes to be committed:
#   modified:   change-me
#   deleted:    delete-me
# Untracked files:
#   add-me

git reset

git add -A
git status

# Changes to be committed:
#   new file:   add-me
#   modified:   change-me
#   deleted:    delete-me

总结

  • git add -A:提交所有变化
  • git add -u:提交被修改(modified)和被删除(deleted)文件,不包括新文件(new)
  • git add .:提交新文件(new)和被修改(modified)文件,不包括被删除(deleted)文件

git版本不同会有所区别

Git Version 1.x

New Files Modified Files Deleted files Description
git add -A
git add .
git add -u

Git Version 2.x

New Files Modified Files Deleted files Description
git add -A
git add .
git add –ignore-removal
git add -u

转自:https://www.cnblogs.com/skura23/p/5859243.html

macOS App如何打包成dmg?

第一步 打包项目

在 XCode 中打开项目,并打包(command + b),在项目的根目录的 Products:

项目根目录的 Products

然后在桌面上新建一个文件夹,随意取个名字(例如:项目名字),然后将Products目录中的.app文件复制进去,为了实现拖拽到Applications的效果,需要在这个文件夹里放一个Applications的替身。具体做法是cd到这个目录,建立一个软链接(用终端):

cd ~/Desktop/[刚刚创建的文件夹]
ln -s /Applications/ Applications

第二步 创建 .dmg 文件

创建.dmg文件需要用到Mac自带的磁盘工具 App。打开磁盘工具,菜单栏选择文件新建镜像来自文件的镜像,然后选择刚刚创建的文件夹,

20190226232906_gGX8S6_Screenshot.jpeg

20190226233118_f9bd3B_Screenshot.jpeg

20190226233346_ts7B5G_Screenshot.jpeg

20190226233330_g8XftH_Screenshot.jpeg

20190226233442_ohIHZk_Screenshot.jpeg

20190226233711_EtC54Z_Screenshot.jpeg

20190226234221_Bg6Bfh_Screenshot.jpeg

然后就OK了。

参考:

  1. MAC APP 打包dmg

PS:cuImage不是自己开发的,引用别人的。

Medium 主题图缩略图

Column A Column B Column C
Art Art CryptocurrencyCryptocurrency ScienceScience
True True Personal FinancePersonal Finance JusticeJustice
Technology Technology ProgrammingProgramming Tvravel
Philosophy Philosophy ComicsComics WomenWomen
Basic Basic GamingGaming AddictionAddiction
Education Education MasculinityMasculinity StyleStyle
Psychology Psychology BusinessBusiness SpaceSpace
Privacy Privacy FictionFiction Data ScienceData Science
Blockchain Blockchain WorldWorld Visual DesignVisual Design
Spirituality Spirituality FamilyFamily WorkWork
Race Race RelationshipsRelationships MathMath
Media Media BooksBooks FilmFilm
TV TV PoetryPoetry EnvironmentEnvironment
Podcasts Podcasts FoodFood HealthHealth
Cities Cities MentalMental ProductivityProductivity
San San LanguageLanguage Machine LearningMachine Learning
LGBTQIA LGBTQIA HumorHumor ParentingParenting
History History PoliticsPolitics SelfSelf
Internet Culture Internet Culture SportsSports PetsPets
Music Music AccessibilityAccessibility SexualitySexuality
Design Design CultureCulture FutureFuture
Medium Magazine Medium Magazine WritingWriting EconomyEconomy
Creativity Creativity ReligionReligion GadgetsGadgets
Startups Startups SocialSocial PsychedelicsPsychedelics
Neuroscience Neuroscience iOSiOS Artificial IntelligenceArtificial Intelligence
Self Self Software EngineeringSoftware Engineering Android DevAndroid Dev
Wellness Wellness FreelancingFreelancing GunGun
Cybersecurity Cybersecurity MarketingMarketing DisabilityDisability
UX UX PhotographyPhotography LeadershipLeadership
Javascript Javascript TransportationTransportation EqualityEquality