聲明:本文原創(chuàng),所有轉(zhuǎn)載必須經(jīng)過(guò)本人同意常空,否則默認(rèn)同意支付本人稿費(fèi)(千字百元)沽一。---緒文(公眾號(hào):LearnWithSiven)
在開(kāi)發(fā)中,項(xiàng)目中會(huì)產(chǎn)生一些我們不希望提交到Git的個(gè)人信息或配置的文件漓糙,現(xiàn)使用.gitignore文件忽略掉铣缠。
Step 1: 進(jìn)入項(xiàng)目目錄:cd ?<ProjectName>
Step 2: 查看狀態(tài): git? stauts
Step 3: 創(chuàng)建gitignore文件:touch? .gitignore? ? #創(chuàng)建隱藏文件gitignore
Step 4: 編輯gitignore文件: vim? ? .gitignore? ? #編輯該文件,下附內(nèi)容,知道Vim基本命令
Step 5: Git添加.gitignore文件: git add .gitignore
Step 6: 現(xiàn)在可以再查看結(jié)果狀態(tài): git? stauts
附:
# ---> Objective-C
# Xcode
#
# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore
## Build generated
build/
DerivedData
## Various settings
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
xcuserdata
## Other
*.xccheckout
*.moved-aside
*.xcuserstate
*.xcscmblueprint
## Obj-C/Swift specific
*.hmap
*.ipa
# CocoaPods
#
# We recommend against adding the Pods directory to your .gitignore. However
# you should judge for yourself, the pros and cons are mentioned at:
# http://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
#
#Pods/
# Carthage
#
# Add this line if you want to avoid checking in source code from Carthage dependencies.
# Carthage/Checkouts
Carthage/Build