문제

어떤 파일에 포함해야 하는 .gitignore 사용하는 경우 Git 와 함께 Xcode?

도움이 되었습니까?

해결책

Mods:시기 바랍 승인하지 않는 편집하는 이 대답이다.지금까지,모든 편집되었는 잘못된 데이터 손실이 발생합니다.Please leave 이 대답이다.


를 편집하려는 경우이다.하지 않습니다.읽는 모든 것은 첫째가는 쉬운 방법은 당신을 위해 자신의 포크,그것이 충분하지 않다면 다음에 댓글을 달니다.


내가 이전 사용 투표에 대답하지만,그것의 비트가 필요한 정리,그래서 여기에 그것은 다시 수행에 대한 Xcode4 다.

I've 연구 파일에서 이 목록은,하지만 그들 중 몇 가지가 존재하지 않는 애플의 공식 xcode 에서 문서,응용 프로그램에 대한 애플 메일링 목록입니다.

애플을 추가 문서화되지 않은 파일을 잠재적으로 손상이 우리의 살아있는 프로젝트입니다.이 이럴 수없는,그리고 내가 지금 시작한 로깅 버그에 대한 그것 때마다 그들은 그렇게했다.난 그들은 걱정하지 않는다,그러나 어쩌면 그것을 부끄러움 중 하나로 그들을 치료하는 개발자가 더 많은 상당히입니다.


사용자 지정해야 하는 경우에,여기에 gist 할 수 있는 포크: https://gist.github.com/3786883


#########################
# .gitignore file for Xcode4 and Xcode5 Source projects
#
# Apple bugs, waiting for Apple to fix/respond:
#
#    15564624 - what does the xccheckout file in Xcode5 do? Where's the documentation?
#
# Version 2.6
# For latest version, see: http://stackoverflow.com/questions/49478/git-ignore-file-for-xcode-projects
#
# 2015 updates:
# - Fixed typo in "xccheckout" line - thanks to @lyck for pointing it out!
# - Fixed the .idea optional ignore. Thanks to @hashier for pointing this out
# - Finally added "xccheckout" to the ignore. Apple still refuses to answer support requests about this, but in practice it seems you should ignore it.
# - minor tweaks from Jona and Coeur (slightly more precise xc* filtering/names)
# 2014 updates:
# - appended non-standard items DISABLED by default (uncomment if you use those tools)
# - removed the edit that an SO.com moderator made without bothering to ask me
# - researched CocoaPods .lock more carefully, thanks to Gokhan Celiker
# 2013 updates:
# - fixed the broken "save personal Schemes"
# - added line-by-line explanations for EVERYTHING (some were missing)
#
# NB: if you are storing "built" products, this WILL NOT WORK,
# and you should use a different .gitignore (or none at all)
# This file is for SOURCE projects, where there are many extra
# files that we want to exclude
#
#########################

#####
# OS X temporary files that should never be committed
#
# c.f. http://www.westwind.com/reference/os-x/invisibles.html

.DS_Store

# c.f. http://www.westwind.com/reference/os-x/invisibles.html

.Trashes

# c.f. http://www.westwind.com/reference/os-x/invisibles.html

*.swp

#
# *.lock - this is used and abused by many editors for many different things.
#    For the main ones I use (e.g. Eclipse), it should be excluded 
#    from source-control, but YMMV.
#   (lock files are usually local-only file-synchronization on the local FS that should NOT go in git)
# c.f. the "OPTIONAL" section at bottom though, for tool-specific variations!
#
# In particular, if you're using CocoaPods, you'll want to comment-out this line:
*.lock


#
# profile - REMOVED temporarily (on double-checking, I can't find it in OS X docs?)
#profile


####
# Xcode temporary files that should never be committed
# 
# NB: NIB/XIB files still exist even on Storyboard projects, so we want this...

*~.nib


####
# Xcode build files -
#
# NB: slash on the end, so we only remove the FOLDER, not any files that were badly named "DerivedData"

DerivedData/

# NB: slash on the end, so we only remove the FOLDER, not any files that were badly named "build"

build/


#####
# Xcode private settings (window sizes, bookmarks, breakpoints, custom executables, smart groups)
#
# This is complicated:
#
# SOMETIMES you need to put this file in version control.
# Apple designed it poorly - if you use "custom executables", they are
#  saved in this file.
# 99% of projects do NOT use those, so they do NOT want to version control this file.
#  ..but if you're in the 1%, comment out the line "*.pbxuser"

# .pbxuser: http://lists.apple.com/archives/xcode-users/2004/Jan/msg00193.html

*.pbxuser

# .mode1v3: http://lists.apple.com/archives/xcode-users/2007/Oct/msg00465.html

*.mode1v3

# .mode2v3: http://lists.apple.com/archives/xcode-users/2007/Oct/msg00465.html

*.mode2v3

# .perspectivev3: http://stackoverflow.com/questions/5223297/xcode-projects-what-is-a-perspectivev3-file

*.perspectivev3

#    NB: also, whitelist the default ones, some projects need to use these
!default.pbxuser
!default.mode1v3
!default.mode2v3
!default.perspectivev3


####
# Xcode 4 - semi-personal settings
#
# Apple Shared data that Apple put in the wrong folder
# c.f. http://stackoverflow.com/a/19260712/153422
#     FROM ANSWER: Apple says "don't ignore it"
#     FROM COMMENTS: Apple is wrong; Apple code is too buggy to trust; there are no known negative side-effects to ignoring Apple's unofficial advice and instead doing the thing that actively fixes bugs in Xcode
# Up to you, but ... current advice: ignore it.
*.xccheckout

#
#
# OPTION 1: ---------------------------------
#     throw away ALL personal settings (including custom schemes!
#     - unless they are "shared")
# As per build/ and DerivedData/, this ought to have a trailing slash
#
# NB: this is exclusive with OPTION 2 below
xcuserdata/

# OPTION 2: ---------------------------------
#     get rid of ALL personal settings, but KEEP SOME OF THEM
#     - NB: you must manually uncomment the bits you want to keep
#
# NB: this *requires* git v1.8.2 or above; you may need to upgrade to latest OS X,
#    or manually install git over the top of the OS X version
# NB: this is exclusive with OPTION 1 above
#
#xcuserdata/**/*

#     (requires option 2 above): Personal Schemes
#
#!xcuserdata/**/xcschemes/*

####
# Xcode 4 workspaces - more detailed
#
# Workspaces are important! They are a core feature of Xcode - don't exclude them :)
#
# Workspace layout is quite spammy. For reference:
#
# /(root)/
#   /(project-name).xcodeproj/
#     project.pbxproj
#     /project.xcworkspace/
#       contents.xcworkspacedata
#       /xcuserdata/
#         /(your name)/xcuserdatad/
#           UserInterfaceState.xcuserstate
#     /xcshareddata/
#       /xcschemes/
#         (shared scheme name).xcscheme
#     /xcuserdata/
#       /(your name)/xcuserdatad/
#         (private scheme).xcscheme
#         xcschememanagement.plist
#
#

####
# Xcode 4 - Deprecated classes
#
# Allegedly, if you manually "deprecate" your classes, they get moved here.
#
# We're using source-control, so this is a "feature" that we do not want!

*.moved-aside

####
# OPTIONAL: Some well-known tools that people use side-by-side with Xcode / iOS development
#
# NB: I'd rather not include these here, but gitignore's design is weak and doesn't allow
#     modular gitignore: you have to put EVERYTHING in one file.
#
# COCOAPODS:
#
# c.f. http://guides.cocoapods.org/using/using-cocoapods.html#what-is-a-podfilelock
# c.f. http://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control
#
#!Podfile.lock
#
# RUBY:
#
# c.f. http://yehudakatz.com/2010/12/16/clarifying-the-roles-of-the-gemspec-and-gemfile/
#
#!Gemfile.lock
#
# IDEA:
#
# c.f. https://www.jetbrains.com/objc/help/managing-projects-under-version-control.html?search=workspace.xml
# 
#.idea/workspace.xml
#
# TEXTMATE:
#
# -- UNVERIFIED: c.f. http://stackoverflow.com/a/50283/153422
#
#tm_build_errors

####
# UNKNOWN: recommended by others, but I can't discover what these files are
#

다른 팁

에 따라 이에 대한 가이드 Mercurial my.gitignore 포함됩니다:

.DS_Store
*.swp
*~.nib

build/

*.pbxuser
*.perspective
*.perspectivev3

나는 또한 선택을 포함한다:

*.mode1v3
*.mode2v3

에 따르면, 이 애플 메일링 목록에 포스트, 은"사용자는 특정 프로젝트 설정".

고 Xcode4:

xcuserdata

에 대한'build'디렉토리를 제외-

는 경우에 당신이 당신의 빌드를 다른 디렉터리에 있는 파일을 소스에서처럼,당신은 없 폴더에 나무 걱정 없습니다.

이것은 또한 생명에 대한 간단한 코드 공유 방지,비 대한 백업하고 있는 경우 종속하는 다른 Xcode 프로젝트(하는 동안 필요한 빌드하는 것에 동일한 디렉터로 각각 다른)

당신이 잡을 수 있는 그대로--날짜를 복사에서 Github gist https://gist.github.com/708713

나의 현재가 있습니다.gitignore 파일

# Mac OS X
*.DS_Store

# Xcode
*.pbxuser
*.mode1v3
*.mode2v3
*.perspectivev3
*.xcuserstate
project.xcworkspace/
xcuserdata/

# Generated files
*.o
*.pyc


#Python modules
MANIFEST
dist/
build/

# Backup files
*~.nib

에 대한 Xcode4 내가 또한 추가합니다:

YourProjectName.xcodeproj/xcuserdata/*
YourProjectName.xcodeproj/project.xcworkspace/xcuserdata/*

내가 포함되어 이러한 제안서 요점을 내가 만든 on Github: http://gist.github.com/137348

포크 그리고 더 나은 만들 수 있습니다.

사람들의 GitHub 에서는 철저하고 문서화되어 있습니다.gitignore 파일에 대한 Xcode 프로젝트:

Swift: https://github.com/github/gitignore/blob/master/Swift.gitignore

Objective-C: https://github.com/github/gitignore/blob/master/Objective-C.gitignore

해야 합 체크아웃 gitignore.io 에 대한 목표 C 와 스

.gitignore 파일 사용

# Xcode
.DS_Store
*/build/*
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
xcuserdata
profile
*.moved-aside
DerivedData
.idea/
*.hmap
*.xccheckout
*.xcworkspace
!default.xcworkspace

#CocoaPods
Pods

나는 모두 사용하여 AppCode 및 XCode.그래서 .idea/ 무시해야 합니다.

추가 이것을 아담의 .gitignore

####
# AppCode
.idea/

Heres 스크립트가 만든 자동차를 만듭니다.gitignore 다.gitattributes 를 사용하여 파일을 Xcode...나는 해킹 그것을 함께 몇 가지 다른 사람들의 물건입니다.재미 있습니다!

Xcode-Git-사용자가 스크립트

보증하지 않...내가 빨에서 대부분의 이용에 당신의 자신의 위험

광산입니다.bzrignore 지만,동일한 아이디어)

.DS_Store
*.mode1v3
*.pbxuser
*.perspectivev3
*.tm_build_errors

이 tm_build_errors 위해 사용하면 파일을 미리 볼 나를 건축하는 프로젝트입니다.매우 포괄적으로 Hagelin 가 가치가 게시한 tm_build_errors 라인입니다.

추가 .gitignore 파일

MAC OS X + XCode +

이것은 어떻게,내가 추가됩니다.gitignore 파일로 내 스위프트는 프로젝트

  1. 선택하신 프로젝트 XCode 에서 오른쪽 클릭--> 새 그룹 -->이 그것은"Git"
  2. 선택 Git 폴더를 오른쪽 클릭--> 추가로 새로운 파일
  3. iOS 탭 ->선택 기타 --> 빈 파일

enter image description here

  1. 파일 이름을 여기에서".gitignore"

enter image description here

  1. 확인하는 파일 이름과 형식

enter image description here

여기에서 결과 구조

enter image description here

  1. 파일을 열고 과거 아래 코드

# file

#########################################################################
#                                                                       #
#       Title         - .gitignore file                                 #
#       For           - MAC OSX , Xcode7 and Swift Source projects      #
#       Updated by    - Ramdhan Choudhary                               #
#       Updated on    - 13 - November - 2015                            #
#                                                                       #
#########################################################################

########### Xcode ###########
# Xcode temporary files that should never be committed

## Build generated
build/
DerivedData

# NB: NIB/XIB files still exist even on Storyboard projects, so we want this
*~.nib
*.swp

## Various settings
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
xcuserdata

## Other
*.xccheckout
*.moved-aside
*.xcuserstate
*.xcscmblueprint
*.xcscheme

########### OSX ###########
# OS X temporary files that should never be committed

.DS_Store
.AppleDouble
.LSOverride

# Icon must end with two \r
Icon


# Thumbnails
._*

# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns

# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk

########## 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:
# https://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

# fastlane
#
# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the

fastlane/report.xml
fastlane/screenshots

감사 Adam, 그의 대답이 나에게 많은 도움을 주었지만 여전히 나를 추가하는 몇 가지 더 항목으로 있습니다.gitignore 한

MAC OS X+XCode+스

참고:

에 대한 XCode5 추가:

####
# Xcode 5 - VCS metadata
#
*.xccheckout

Berik 의 응답

추가했:

xcuserstate
xcsettings

배 my.gitignore 루트에 있는 파일의 프로젝트입니다.

후에 투입 및 추진입니다.나는 다음 달렸다:

git rm --cached UserInterfaceState.xcuserstate WorkspaceSettings.xcsettings

매장으로 폴더 아래:

<my_project_name>/<my_project_name>.xcodeproj/project.xcworkspace/xcuserdata/<my_user_name>.xcuserdatad/

나는 다음 달 git commit 및 푸시 다시

내가 사용하는 다음과 같습니다.gitignore 파일에서 생성 gitignore.io:

### Xcode ###
build/
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
xcuserdata
*.xccheckout
*.moved-aside
DerivedData
*.xcuserstate


### Objective-C ###
# Xcode
#
build/
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
xcuserdata
*.xccheckout
*.moved-aside
DerivedData
*.hmap
*.ipa
*.xcuserstate

# 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-ignore-the-pods-directory-in-source-control
#
Pods/

모든 최고의

gitignore.io

가고 당신의 언어를 선택,그것은 당신에게 파일입니다.

.gitignore 는 GitHub 에서 기본적으로 사용하는을 위한 새로운 Xcode 저장소:

https://github.com/github/gitignore/blob/master/Objective-C.gitignore

그것의 가능성이 있는 합리적으로 올바른 주어진 시간이다.

우리가 발견되는 경우에도 추가한다.gitignore 및니다.gitattribte 는*.pbxproj 파일을 얻을 수 있는 손상되었습니다.그래서 우리는 간단한 계획이다.

모든 사람 코드는 사무실에서 단순히 폐기 변경이 파일입니다.에서 커미 우리는 간단한 언급된 파일에 추가됩니다.를 밀어를 서버입니다.우리는 통합 관리자를 끌어를 본 commit 내용과 파일을 추가합으로 자원입니다.

일단 그 업데이트를 원격 모든 사람들이 항상 작동하는 복사합니다.는 경우에 뭔가가 다음에 우리는 그에게 알리를 추가한 후 당겨 다시 한 번.

이를 위해 많은 일을 하지 않고 우리는 어떤 문제입니다.

내가 사용하는 것이 좋습니다 joe.gitignore 파일입니다.

IOS 프로젝트는 다음과 같은 명령을 실행합니다:

$ joe g osx,xcode > .gitignore

을 생성 이 .gitignore:

.DS_Store
.AppleDouble
.LSOverride

Icon
._*

.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns

.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk

build/
DerivedData

*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
xcuserdata

*.xccheckout
*.moved-aside
*.xcuserstate

대부분의 답변에서 Xcode4-5 시대입니다.내가 추천하는 무시한 파일에서 현대적인 스타일입니다.

# Xcode Project
**/*.xcodeproj/xcuserdata/
**/*.xcworkspace/xcuserdata/
**/*.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
**/*.xcworkspace/xcshareddata/*.xccheckout
**/*.xcworkspace/xcshareddata/*.xcscmblueprint
.idea/

# Xcode Injection
IOSInjectionProject/
OSXInjectionProject/

# Build
build/
DerivedData

# CocoaPods
Pods/

# fastlane
fastlane/report.xml
fastlane/Preview.html
fastlane/screenshots
fastlane/test_output
fastlane/sign&cert

# CSV
*.orig
.svn

# Other
*~
.DS_Store
*.swp
*.save
._*
*.bak

계속 업데이트: https://github.com/BB9z/iOS-Project-Template/blob/master/.gitignore

구조의 표준.gitignore 파일에 대한 Xcode 프로젝트>

.DS_Store
.DS_Store?
._*
.Spotlight-V100
.Trashes
Icon?
ehthumbs.db
Thumbs.db
build/
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
!default.xcworkspace
xcuserdata
profile
*.moved-aside
DerivedData
.idea/
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top