The SVN repository I was using for XCode was relocated to another server and I was require to perform the relocate inside XCode. The command I used for relocating was:
svn relocate oldLocation newLocation
The command itself worked great. The problem I'm encountering is that now whenever I click on Source Control -> Commit, the GUI that appears doesn't show any of the modified files.
If I use the command line and use either svn stat and svn commit, I can perform the necessary functions. While the command line tools work, it does add a lot of time when trying to commit any modified files. Is there another setting within XCode that I need to change in order to allow myself to commit using the GUI?
Related
Occasionally, Xcode shows "File is Unversioned" in the Version Editor (and shows a question mark by its name) for a file that has already been updated and committed several times in the past. If I go ahead and commit the file again, Xcode then shows the complete history in the Version Editor. I did not rename or move the file when this happens.
Is there a way I can force Xcode/git to recognize the file without re-committing it?
I'm currently using Xcode 10.2.1.
I used the command line once
git add .
git commit -m "your commit message"
git push origin main
After that, everything on XCode Source Control worked as per usual.
I am running Xcode 8.2.1, and am using github version control. Normally, I am able to press Source Control in the top bar, and then Commit. This menu usually shows all of the files I have changed on the local branch, and I can click through the files and see the local diff. When I run "git status" in the terminal, the modified files show up. Are there any ways that this could be unlinked from my source control? I have set my Source Control preferences to Enabled, and have all of the options selected except "Show Git merge commits in history"
No, you can’t unlink terminal from xcode.
In xcode, what you did is based on local working copies. And the git commands you used in terminal is also based on local git repo. So git status from xcode and terminal should always be synchronized.
If you want xcode to show which files are changed before you use source control -> commit to find the changed files, there is no good ways on xcode. You can use the command git status you find these files.
Or you can feedback this request here, such as change the icon to red check mark if the file is changed (no changed files with blue lock icon).
The last 5 or 10 sessions, whenever I go to start source control (Source Control > Create Working Copy), I'm prompted by a message "All projects are already under source control." For each of these projects that this message popped up on, I went to the directory of the session in Terminal and ran ls -a to check for hidden files and see if .git files really existed. I did this in the directory the Xcode sessions are located and went back one folder at a time, checking each folder for .git files as well, but none of the parent directories have .git files either. The only way I can get Xcode to start source control is if I use terminal to make the first git commit:
git init git add . git commit -m "Initial Commit." This never used to happen before, I used to always be able to start source control through Xcode.
Then I can use Xcode source control after.
Anyone know of a fix?
On OS 10.12.3 and Xcode 8.2.1
I wrote a solve in the form of articles at a similar issue.
https://stackoverflow.com/a/50751648/2036103
hope will help someone.
The message All projects are already under source control, means the project has already controled by git (.git folder in the same path or as the parent path of the). So what you need to do for the project in xcode is to commit/pull/push. Or you can config the project by source control -> project (usually above create working copy item) -> configure git.
If you want add a file in the same git repo, you should add a file in the path same as .git or it's sub-path, then in xcode -> source control -> commit -> select the file you added -> commit.
If you want to do source control for another project, you should close the current project, and then reopen xcode with another project.
First of all, I am new to Git. Using Git Bash, I created a feature branch 123-Feature-A using git branch 123-Feature-A, checked it out and then added some files through Visual Studio 2010. Git status showed the new files, I added them using git add . - since I have the VS2010 Git Source Control provider installed, I can see the icon changed to indicate that the file has been added.
When I want to switch branches I run something like git commit -a -m "added files" in the feature branch and then switch back to the master branch. When I am in the master branch, I see the files in VS2010, but the icon has a exclamation point and when I try to open it, VS tells me it does not exist - is there a setting in VS to hide files that I added in Brand-A, if I switch to Branch-B
It's been a while, but I think when I had this same issue I installed a git extension to VS.
Try http://www.codeproject.com/Articles/354101/Source-Code-Versioning-with-Git-in-Visual-Studio Or: http://gitscc.codeplex.com/
If you install one of these, make sure to use it consistently to manage git. That will keep VS up to date.
your workflow is totally fine from Git stand point but may be confusing for VS, assuming you have no Git support in it. Eclipse with git plugin detects this scenario just fine and if needed F5 (project refresh) resolves most of issues.
Just double check that you do have git support in your VS, i.e. that you can for example make git commits, switch branches etc. Otherwise, VS will be always confused in such scenarios, because of the way how git operates when branch is changed.
I'm sort of stumbling around with an issue with Xcode 4, and Git. I'm a one man shop with multiple macs, and had my project working with Git and Xcode4, (stored on a dropbox folder), so I could share that folder across my MBP and iMac with minimal interaction. So, it was late one night and I accidentally committed my xcode project file, and then I started getting issues with UserInterfaceState.xuserstate constantly updating... Later learned that .gitignore would have been good to have in place.
Back to the drawing board and I've been trying to take the new (old) project and enable git on it with the following:
$cd path/to/project
$git init
$git add .
$git commit -m "Initial commit of project"
This works fine, now I'm back in XCODE, and add the repository, which it recognizes in Organizer. One Issue is XCODE doesn't recognize that I've modified a file, and the majority of the "Source Control" menu items are disabled, Ex: "Commit"
I'm wondering if there are a recommended # of steps to:
1) Get Git running on a xcode project that wasn't set up this way initially
2) Steps to add the Gitignore file and when
Ultimately would like the "Source Control" menu items enabled again.
I'm obviously learning some Git SCM related items with xcode 4, and I appreciate your feedback!
Maybe this isn't the answer you want but I gave up on getting Xcode4 to play well with git and just started using the excellent (and free) SourceTree. It really made my life easier.
To add Git to the project
Go to the directory and in a terminal window
cat > .gitignore
build/*
*.pbxuser
*.perspectivev3
*.mode1v3
javascripts/phonegap.*.js
Type Ctrl+D to close the file.
Initialize the Git repository
git init
git add .
git commit -m
Add the repository in organizer. Use the full directory path.
Caveat - this still does not enable Source Control menu items. But you can use git from the command line.
See other related post: Using Git with an existing XCode project
There are three ways of setting up exclude files in git. Which is easiest depends on you. But, I find that when using git to share for myself amongst multiple machines, a global ignore file works best, and I can always add more specific excludes if you need to.
Essentially
Globally, by setting up a per user or per machine exclude file
Per repository - by setting up a .gitignore file in the repo
Per clone - by setting up the `.git/info/excludes file
I've got a my global exclude file on Github if you want to see an example, including Xcode4 specific exclusions.