How to deal with old files in hg repo - xcode

I have a project I started with Xcode 3.0. Back then source files were stored in the root directory by default. A long time ago I even did this. Things have evolved, both the project and Xcode and I now have a curious situation:
I have a root folder with the .xcodeproj folder used by Xcode and a ton of old source files I will not use again. More recent versions of Xcode have created a similarly named folder where more recent source files exist.
I'd like to clean up my repository. What should I do with the files I am no longer using? Move them to a separate folder? hg rm? Checkout the repository anew but from a specific revision?

Just do hg rm, files will be moved out of way but kept in the history. That's the very reason why version control exists. Should you ever need them in the future, checkout a past commit and they will be back.

Related

Remove already committed image files from github / Visual Studio git

I have been working on a Net Core project in Visual Studio.
I just realized that all of the image files I have placed in my wwwroot folder have been uploaded to my GitHub repository.
I would like to remove these files from the repository but retain them locally in the VS project.
I have created a .gitignore file and placed it in the wwwroot directory to prevent this from happening again, but am not sure how to remove the files currently uploaded.
I have made several commits since the files were uploaded (but before I realized they were there) so I would prefer not to revert to that point.
I would recommend to use the new git filter-repo which replaces BFG and git filter-branch.
Note: if you get the following error message when running the above-mentioned commands:
Error: need a version of `git` whose `diff-tree` command has the `--combined-all-paths` option`
it means you have to update git.
First: do that one copy of your local repo (a new clone)
See "Path based filtering":
git filter-repo --path file-to-remove --invert-paths
At the end, you can (if you are the only one working on that repository) do a git push --force
Then restore your files locally.
Since your .gitignore is already in place, they won't be added and committed in the future.

How does Xcode know my commit history?

When I started my project I used Git in the terminal to track changes. Then I realized source control is built into Xcode. So I committed all my changes, everything worked well. Then I went to history in Xcode and saw all my previous commits made from the terminal.
How does Xcode know about those commits? Especially since I haven't signed into my Git repo in Xcode.
The Git history is kept locally in the project's .git folder. When you open Xcode, it finds your local .git folder and uses it to show the project's history.
You don't have to push to your remote Git repo for that, since the history is kept locally.

Xcode missing file warnings after removing Git manually

I while ago I removed the .git folders manually from my Xcode (5) project and switched to svn. Ever since I have about 400 missing file warnings like
file:.../.git/objects/f2/4f16e85d07b97f2953a15b302a626806530431: warning: Missing file:
.../4f16e85d07b97f2953a15b302a626806530431 is missing from working copy
Strange thing is, Xcode sees the project as a svn repository, I can view the revisions.
I think that those files are still somewhere in my project.pbxproj file.
Is there some way to remove these references automatically without destroying my svn repository? I am afraid that disabling version control from preferences will disable subversion and not fix my problem.
It is not a huge problem, but it's kind of annoying.
It's complaining about files in your ".git" folder.
Go to Terminal and "cd" followed by the path of the folder where your source code lives.
For example, something like: "cd /Users/whateveryournameis/Desktop/YourAppLivesInHere".
Then type in "ls -al .git". If you see one listed, you can remove the whole folder via "rm -rf .git".
Well turns out it was a svn problem. I had deleted the .git files, but they where still in the svn repository. Did an update, then an svn delete on the .git folder, recommitted.
The files where still reported missing for me in Xcode, so I created an empty .git directory, added it, deleted it with svn delete and restarted Xcode, the warnings are gone :)

Annoying svn issue where svn claims folder is under version control but no .svn exists

I have a folder that both XCode and SmartSVN both claim is "already under version control." However, when I run svn status in that folder, it says it is not a working copy. Furthermore, I cannot add or subtract the folder from the working copy in SVN, for if I add it (with or without recursion) it claims it is already under version control, and yet there is no context option for me to remove it from said version control.
Furthermore, when I check to see if there is a .svn folder in that directory, there is not.
I have tried svn cleanup in the working directory root as well as the directory in question. When performed at the root it completes with no messages. When performed in the directory, it informs me that it is not a working copy.
It is causing an annoying Obstructing - warning in XCode that is bugging me.
If anyone knows what I am talking about or has experienced the same thing please help me out!
It happens when the parent folder gets out of sync with some of its children. A possible workaround is renaming the parent folder offline (using the file system, not via svn), get a fresh copy from the repository and then bring back your modifications from the renamed folder (excluding the.svn ones).
When finished delete the renamed folder. Otherwise you might end up with broken folders:
If you renaming a project, Xcode does not remove the .svn directory in
the .xcodeproj. As a result, svn gets confused, thinking the renamed
project directory is under version control
[source]
Make sure XCode and SmartSVN are expecting the right version of you SVN installation. After last upgrade of SVN, I noticed that things have changed in how SVN handles things. Everything is now stored in the root checkout folder, and you don't have .svn folder in ech sub folder anymore.

deleted folder under svn control, replaced with folder of same name with different content, now svn wont work!

I have recently upgraded one of our systems from Code Igniter 1.7.2 to 2.0.1.
Do do this you are required to replaced the system directory with a newer version.
The old CI system was under version control, including the system directory.
When I go to commit I get
So I go to execute the cleanup command and I get
How can I fix this?
Backup the new system directory somewhere else (outside of the SVN working copy), revert the working copy to its old state (or even do a fresh checkout if needed), delete the system folder and commit, then copy the backed up system folder into the working copy, add it to SVN and commit again.
If you just deleted the system folder (without svn remove to let subversion know) and replaced it with some other content, you could first bring back the last committed version of it and then replace or update the content with svn.
Example: Backup and remove the current system folder, do a svn update in "tada", "system" comes back. Now either svn remove it to svn add and commit the newer files or copy the new ones over it and commit the changes.

Resources