How can I move files & folders using git in Xcode 4?
I’m familiar with the differences between groups and actual directories in Xcode. I always create an actual folder in finder and drag it into the project, ensuring ‘copy’ is un-checked.
When I move folders, I delete the items by reference only, move them in finder, then re-add them.
Now I’m using git for the first time, and discovered in my testing that if I remove a directory using the method described above, I can’t do a commit. Xcode tells me it can’t switch to the directory because ‘no such file or directory.’ From what I’ve found online, git isn’t notified of the directory changes when done in Xcode.
How can I move files & folders using git in Xcode 4 and have the compiler and git be aware of the moves so I can commit?
- Why does xcode throw this error even though the profiles are set to distribute?
- How to differentiate multiple targets with Xcode 4.2
- XCode: What do I have to type into the Terminal, in order to change the copyright notice in code templates?
- Adding keys to Nested NSDictionary
- Xcode - SenTestingKit not found
- How can I check if a reuse identifier has been registered with a UITableView already?
2 Solutions Collect From Internet About “How can I move files & folders using git in Xcode 4?”
You shall not move files in a GIT repository using the Finder. You’d better use the move command from shell.
You then have to manually redresh links in XCode (or remove/add files again).
Moving a file is similar to the unix ‘mv’ command, with the ‘git prefix:
git mv path destination
(use -f to override destination… with caution)
After you have made all your changes in the Finder, open a terminal window and navigate to your project’s directory:
then run this command:
git add --all
This command will stage all of the changes and Xcode should be able to resume its management of the repository from here.
- How do I specify that a non-generic Swift type should comply to a protocol?
- CoreGraphics FillPath And Stroke Path
- iOS – Ping with timeout
- Swift Dictionary Initialization of custom type gives: '>' is not a postfix unary operator error
- How to remove insertion of double quotes on marked word in Xcode 9
- Swift – How to present ViewController when tapping button in a custom AlertController
- iOS open source drawing application source code
- How to toggle visibility of NSSplitView subView + hide Pane Splitter divider?
- Writing and reading custom object to file IOS
- Print appended struct (swift4)
- How to make UIAppearance proxies apply to programmatically created views?
- Center text in a UILabel
- How do I accept a self-signed SSL certificate using iOS 7's NSURLSession and its family of delegate methods for development purposes?
- Memory Leak with ARC
- iOS swift NSMutableData has no member appendString