Tags: xcode5svn xcodesvn with the SVN xcodesvn version of Xcode, Xcode comes with SVN version |
|
These two days in response to the boss request, put all the code on the company's SVN server, according to my idea is to set up a server on Apple, and then the internal version control, comes with Xcode this function, has done so before, but xcode4. The X series SVN is still good, and has not been done since the upgrade to XCODE5. Today tried for an afternoon or not fully understand, see can not get out, directly with the command line, but some simple things still try out.
1. How to check out a project from a corporate server using XCODE5 SVN
Choose Source Control > Check out.
Select the repository you want-check out, and click Next.
You can select your repository from the Repositories tab, the Favorites tab, or the Recents tab. If you know the location of the repository you want to check out, you can also enter the address manually.
If Xcode is unable to automatically identify the trunk and branches, use the browser windows to select the correct project Location, and click Next.
In the Checkout window, select the branches and working copies to check out, and click Next.
You'll be presented only with the necessary options for your repository. If your project contains only a working copy, you'll only have a to select the branch to checkout. If your project doesn ' t contain branches, you are only being given an option from working copies to checkout. If you are a single working copy with no branches, this dialog would be skipped entirely.
Select the location to store the working copy, and click Check out.
2. When there is a change, in the source control can do something, I tried the next commit, can be submitted to the local, but did not commit to the server, the middle includes 1012 errors, and then configure the GIT username and mailbox. Then fill in the version comments, and then submit, seemingly submitted successfully, but not on the server.
3.Push local changes: I clicked to try, came out below this, I was a little puzzled, later found that people are
push local changes to a remote git repository
Then I have a little doubt, does Xcode's own SVN subversion type support the ability to submit to the server?
Then look at the help document, there is a sentence.
If you ' re using subversion, a commits operation copies the changes from selected files into the remote subversion repositor Y. Therefore, you must is connected to the repository before you can commit changes. (For details, see your repository administrator.)
Did not understand for a long while see your repository administrator is what mean. The translator is a library administrator. I just want to say that he has a fur. I can silently self-deprecating English poor.
4. And then I just thought I'd keep looking down. Updating or pulling changes from a Repository
How to update and commit changes. Then you will see the following content.
Update your project with changes from the repository using the Source Control menu.
For a Git repository, choose Source Control > Pull.
For a Subversion repository, choose Source Control > Update.
For a project this contains both Git and Subversion repositories, choose Source Control > Update and Pull.
For projects with multiple repositories, select the ones you want to update.
Resolve differences by using the left and right buttons to specify which file ' s contents to use.
After reconciling all differences, click Pull (Git) or Update (SVN) to complete the operation.
Pull and update are not found when you open source control. The English is poor, the mother happened to recognize these words, and then forget about it. Daniel, don't laugh at me and tell me what's wrong.
Read a question and answer, XCODE5 how to upload to SVN server, the foreigner gives the conclusion is: two methods, one is to use SVN client software, the other method is the command line. One is using a SVN client. The one which is obviously available are the command line SVN client.
Http://stackoverflow.com/questions/18894195/xcode-5-export-project-to-svn-repository
But things can not be done, on the Internet to find the order experiment, as far as possible to write detailed points, the next time you look at the understood. Help people who are depressed like me.
1. Change the configuration (just skip it if you don't understand it)
bogon:~ chenshuangchou$ Open ~/.subversion/config
Start the configuration file, and then select the file type to ignore in the configuration file
Find the Global-ignores line, remove the comment, edit it into
Global-ignores = Build *~.nib *.so *.pbxuser *.mode *.perspective*
# global-ignores = *.o *.lo *.la *.al. Libs *.so *.so. [0-9]* *.a *.pyc *.pyo
Find Enable-auto-props = yes to remove the comment and declare the following text file in the [Auto-props] section
*.mode* = Svn:mime-type=text/x-xcode
*.pbxuser = Svn:mime-type=text/x-xcode
*.perspective* = Svn:mime-type=text/x-xcode
*.pbxproj = Svn:mime-type=text/x-xcode
2.import command
First import the local code into the repository
bogon:~ chenshuangchou$ svn import/users/chenshuangchou/desktop/buickios/buickhousekeeper https:// 192.168.21.248:8443/svn/buickios/-M "Initial import"
3 . Checkout Command
Then from the repository checkout, this directory is equivalent to be activated, the internal and the server Address Association.
bogon:~ chenshuangchou$svn Checkout https://192.168.21.248:8443/svn/BuickIOS//users/chenshuangchou/desktop/ Buickios
4 . Add Command
When there are new files added to the repository with the Add command, then submit
SVN add/users/chenshuangchou/desktop/buickios/buickhousekeeper/viewcontrollers/carviewcontroller/ Fuelmanageviewcontroller/lastmouth_color1.png
The prerequisite for executing this instruction is that/users/chenshuangchou/desktop/buickios/is a directory checkout down from the server, which is a working copy
The new success will be
A (BIN) desktop/buickios/buickhousekeeper/viewcontrollers/carviewcontroller/fuelmanageviewcontroller/lastmouth_ Color1.png
5 . Commit Command
Submit content to Repository
bogon:~ chenshuangchou$ svn commit-m "added a fuel consumption histogram"/users/chenshuangchou/desktop/buickios/buickhousekeeper/ Viewcontrollers/carviewcontroller/fuelmanageviewcontroller/lastmouth_color1.png
Commit to Repository successfully,
Adding (BIN) desktop/buickios/buickhousekeeper/viewcontrollers/carviewcontroller/fuelmanageviewcontroller/ Lastmouth_color1.png
Transmitting file data.
Committed Revision 3.
6 . Update Command
Update the repository to local, update the specified directory, SVN update if there is no directory, the default is to update the current directory and all files under subdirectories to the latest version.
bogon:~ chenshuangchou$ SVN update/users/chenshuangchou/desktop/buickios1
Update successful
Updating ' DESKTOP/BUICKIOS1 ':
A Desktop/buickios1/buickhousekeeper/viewcontrollers/carviewcontroller/fuelmanageviewcontroller/lastmouth_ Color1.png
Updated to Revision 3.
Fallback to version 2:
bogon:~ chenshuangchou$ svn update-r 2 desktop/buickios1/
A successful fallback
Updating ' DESKTOP/BUICKIOS1 ':
D Desktop/buickios1/buickhousekeeper/viewcontrollers/carviewcontroller/fuelmanageviewcontroller/lastmouth_ Color1.png
Updated to Revision 2.
Conflict
(Update, sync in Repository.) If the prompt expires at the time of submission, it is because of the conflict, you need to update, modify the file, then clear the SVN resolved, and then commit the commit)
What happens when a version conflict occurs on commit
bogon:~ chenshuangchou$ svn commit-m "added a sentence in delegate"/users/chenshuangchou/desktop/buickios/
Sending Desktop/buickios/.git/index
Sending Desktop/buickios/buickhousekeeper/appdelegate.h
Sending desktop/buickios/buickhousekeeper.xcodeproj/project.xcworkspace/xcuserdata/chenshuangchou.xcuserdatad/ Userinterfacestate.xcuserstate
Transmitting file Data ...
Committed Revision 4.
bogon:~ chenshuangchou$ svn commit-m "added a different word to delegate"/users/chenshuangchou/desktop/buickios1/
Sending Desktop/buickios1/.git/index
Svn:E160042:Commit failed (details follow):
Svn:E160042:File or directory '. Git/index ' is an out of date; Try Updating
Svn:E160024:resource out of date; Try Updating
Out of date indicates that the version expires, possibly because another developer has updated the server version, while the local code conflicts with the server
In this case, you should update the server first and then submit
bogon:~ chenshuangchou$ SVN update desktop/buickios1/
Updating ' DESKTOP/BUICKIOS1 ':
Conflict discovered in '/users/chenshuangchou/desktop/buickios1/.git/index '.
Select: (p) Postpone,
(MF) mine-full, (TF) Theirs-full,
(s) Show all options:
There will be a selection here, select (s) to display all comments for all options, as follows
(s) Show all-show this list
(e) Edit-change merged file in an editor
(DF) Diff-full-show All changes made to merged file
(r) resolved-accept merged version of file
(DC) Display-conflict-show all conflicts (ignoring merged version)
(MC) Mine-conflict-accept my version for all conflicts (same)
(TC) theirs-conflict-accept their version for all conflicts (same)
(p) Postpone-mark the conflict to be resolved later.
(MF) mine-full-accept My version of entire file (even non-conflicts)
(TF) theirs-full-accept their version of entire file (same)
Selecting one will continue to show the conflict point until the end. And every point will ask how to deal with it.
G desktop/buickios1/buickhousekeeper.xcodeproj/project.xcworkspace/xcuserdata/chenshuangchou.xcuserdatad/ Userinterfacestate.xcuserstate
Conflict discovered in '/users/chenshuangchou/desktop/buickios1/buickhousekeeper/appdelegate.h '.
Select: (p) postpone, (DF) Diff-full, (e) Edit,
(MC) Mine-conflict, (TC) Theirs-conflict,
(s) Show All OPTIONS:TF
G desktop/buickios1/buickhousekeeper/appdelegate.h
Updated to Revision 4.
After you select TF, the conflict points are overwritten by the code on the server, and your local code is permanently missing. It is best to select postpone before you can modify it.
For conflicts, refer to: http://www.logicaltrinkets.com/wordpress/?p=178
7 . Status Command
View file or directory status
SVN status path (status of files and subdirectories under directory, normal status not shown)
?: not in SVN control; M: Content modified; C: conflict; A: Scheduled to be added to Repository; K: Locked
SVN status-v Path Displays the modification information of all files, while viewing the status, displays the local current version number, the last modified version number and the modified person, respectively, in the previous
bogon:~ chenshuangchou$ SVN status desktop/buickios1/
M Desktop/buickios1/.git/index
? desktop/buickios1/.git/objects/1c/7d8324a67dcd866bd0b4122b01b924a0e77128
? Desktop/buickios1/.git/objects/75/1826a72a4afd4b15faf73a0b6e4166d3bbec01
? desktop/buickios1/.git/objects/a4/1c23190a65cda6a64a95bef22a9264ad64d90e
? desktop/buickios1/.git/objects/b3/df5dbb592745d9744adf7a32ed2bb39370c78e
M desktop/buickios1/buickhousekeeper/appdelegate.h
? Desktop/buickios1/buickhousekeeper/lastmouth_color1.png
? Desktop/buickios1/buickhousekeeper/lastmouth_color2.png
? Desktop/buickios1/buickhousekeeper/lastmouth_color3.png
? Desktop/buickios1/buickhousekeeper/lastmouth_color4.png
M desktop/buickios1/buickhousekeeper.xcodeproj/project.pbxproj
M desktop/buickios1/buickhousekeeper.xcodeproj/project.xcworkspace/xcuserdata/chenshuangchou.xcuserdatad/ Userinterfacestate.xcuserstate
8 . Delete Command
SVN delete path-m "Delete test Fle"
To delete a blank folder:
bogon:~ chenshuangchou$ SVN delete/users/chenshuangchou/desktop/buickios/branches
D desktop/buickios/branches
Show Delete Succeeded
9 . Log Command
View version history, also called log
bogon:~ chenshuangchou$ SVN Log/users/chenshuangchou/desktop/buickios
------------------------------------------------------------------------
R3 | CHENSC | 2013-10-31 11:34:03 +0800 (Thu, 31 10 2013) | 1 line
Added a fuel consumption column chart
------------------------------------------------------------------------
R2 | CHENSC | 2013-10-28 12:00:36 +0800 (one, 28 10 2013) | 1 line
Initial Import
------------------------------------------------------------------------
R1 | VISUALSVN Server | 2013-06-28 17:40:29 +0800 (five, 28 6 2013) | 1 line
Initial structure.
There are only two release notes, stating that the second and third versions did not add a version description, that is, when the instruction was executed without-m, the instruction was to add a comment
Ten . diff Command
SVN diff path (compares the modified file to the base version)
When uploading a version, you may have your own version inconsistent with the server version, you need to see the specific code, this command can be done
SVN diff-r m:n Path
Compare differences between version m and version n
This command is also useful when tracing the version issue.
bogon:~ chenshuangchou$ SVN diff/users/chenshuangchou/desktop/buickios1
---/users/chenshuangchou/desktop/buickios1/buickhousekeeper/appdelegate.h (revision 4)
+ + +/users/chenshuangchou/desktop/buickios1/buickhousekeeper/appdelegate.h (working copy)
@@ -6,6 +6,7 @@
Copyright (c) 2013 calinks. All rights reserved.
It's a good test.
+
#import
#import "BMapKit.h"
@@ -15,7 +16,7 @@
-(void) refreshideamessage;
-(void) refreshmaintainmessage;
[Email protected]
[Email protected]
One . Merge Command
Merging differences between two versions into the current file
Bogon:buickios chenshuangchou$ svn merge-r 4:5/users/chenshuangchou/desktop/buickios/buickhousekeeper/ AppDelegate.h
Conflicts are common and conflict is handled
-/USERS/CHENSHUANGCHOU/DESKTOP/BUICKIOS/BUICKHOUSEKEEPER/SVN-1FUB4K 410 31 15:36:15 2013
+ + +/users/chenshuangchou/desktop/buickios/.svn/tmp/appdelegate.h.tmp 410 31 15:36:16 2013
@@ -4,8 +4,13 @@
Copyright (c) 2013 calinks. All rights reserved.
-//is a good test.
+<<<<<<<. Working
+//, test it.
+=======
+//Verifying version difference merging
+>>>>>>>. Merge-right.r5
A . ls Command
List of files and directories under the repository
SVN list path displays all files and directories belonging to the repository under the path directory
Bogon:buickios chenshuangchou$ svn ls https://192.168.21.248:8443/svn/BuickIOS/
. git/
buickhousekeeper/
buickhousekeeper.xcodeproj/
devonesdk.framework/
branches/
tags/
trunk/
- . Log Command
View file Details
bogon:~ chenshuangchou$ SVN info/users/chenshuangchou/desktop/buickios/buickhousekeeper/appdelegate.h
Path:desktop/buickios/buickhousekeeper/appdelegate.h
Name:appdelegate.h
Working Copy Root Path:/users/chenshuangchou/desktop/buickios
Url:https://[email protected]:8443/svn/buickios/buickhousekeeper/appdelegate.h
Repository Root:https://[email Protected]:8443/svn/buickios
Repository UUID:9A03820F-37B7-B94A-A594-74C58A350BC6
Revision:4
Node Kind:file
Schedule:normal
Last Changed AUTHOR:CHENSC
Last Changed Rev:4
Last Changed date:2013-10-31 14:04:51 +0800 (Thu, 31 10 2013)
Text last updated:2013-10-31 14:02:51 +0800 (Thu, 31 10 2013)
Checksum:83d8a08d317af33501b650517aa4033d5fe9f0d4
- . Other Commands
svn mkdir : Create a new directory under the included version control.
Usage: 1, mkdir PATH ...
2. mkdir URL ...
svn revert : Restores the original unchanged working copy file (restores most of the local modifications). Revert
Usage: revert PATH ...
Note: The notebook command will not access the network and will release the conflicting condition. But it won't recover.
Directories that were deleted
SVN switch (SW): Updates the working copy to a different URL.
Usage: 1, switch URL [PATH]
2. Switch--relocate from to [PATH ...]
SVN resolved: Removes the "conflicting" status of the working Copy's directory or file.
Usage: Resolved PATH ...
Note: The book command does not resolve the conflict by syntax or remove the conflict token; it simply removes the conflicting
File, and then allow PATH to submit again.
SVN cat output Specifies the contents of a file or URL.
SVN cat Target [@ VERSION] ... If a version is specified, the lookup starts from the specified version.
SVN cat-r PREV filename > filename (PREV is the previous version, you can also write a specific version number so that the output can be submitted)
iOS development XCODE5 SVN configuration usage (GO) collect a bit