Re: Xcode git updates
Re: Xcode git updates
- Subject: Re: Xcode git updates
- From: "Pelaia II, Tom" <email@hidden>
- Date: Thu, 14 Apr 2011 09:55:49 -0400
- Acceptlanguage: en-US
- Thread-topic: Xcode git updates
I am using the two branch technique you proposed as it seems to work, but Xcode is not making it easy for me. It crashes when I switch branches unless I close the project which just adds to the overhead. Here are the steps necessary to work with Git and a remote branch in Xcode assuming you have two local branches (master tied to the remote and working which is strictly local):
- Open Organizer and switch to view repositories to verify that you are working in the "working" branch
- Open your project
- Modify code and commit changes
- Close your project
- Use Organizer to switch branch to "master"
- Open your project
- Merge changes from the "working" branch with a perpetual conflict on xib files that have ever been modified since branching
- Push changes to the remote
- Pull changes from the remote
- Close the project
- Use organizer to switch branch to "working"
- Open the project
- Merge changes from the "master" branch
Those are a lot of steps to synchronize with the remote repository! Is this really the intended scenario?
The opening and closing of the project are necessary to avoid Xcode crashing, and even then sometimes the SCM status gets messed up and it can't seem to identify that some files have modifications and this requires quitting and restarting Xcode (not just the project).
On Apr 13, 2011, at 5:11 AM, Rory O'Bryan wrote:
> I've been learning about GIT and Xcode over the last few days and I haven't seen a way to do exactly what you want.
>
> However I think you could get the basic functionality you're after if you used two branches in Xcode.
>
> One branch would track the branch on the remote repository as it does now, and a new branch would act as your local "working" branch. You can pull the tracking branch to get new changes down to your local repository, and then use the version comparison tools in Xcode to compare the differences. Once you are satisfied with the changes you can then merge them into your "working" branch.
>
> Later on, when you are ready, you can merge your "working" branch changes back over to the tracking branch and push it all back up to the remote repository.
>
> I'm not sure how convenient the version comparison options are in Xcode for this workflow. I know you can use the Organiser -> Repositories window to inspect the changes in a branch compared to itself, and then the version editor in the main IDE will compare individual file across branches. So between the two I think you can work out the sum of all the changes that will take place but I don't think there's any way to directly compare entire branches like you get during a merge.
>
> Of course you could also make use of a third local "test_merge" branch to test the merge and get an overview of what will happen, which may not be as crazy as it sounds, GIt is all about making branching and merging easy. In this case your workflow would be...
>
> 1) Switch to the "master" branch and pull the changes from remote repository.
> 2) Use Organiser -> Repositories to inspect the changes in the "master" branch.
> 3) For simple changes just switch to the "working" branch and merge in from "master"
>
> 4) For complex changes, create a new "test_merge" branch based on the "working" branch.
> 5) Switch to the "test_merge" branch and merge from the "master" branch.
> 6) Inspect the changes using the merge window and the version editor.
> 7) Once you are ready delete the "test_merge" branch.
> 8) Switch to "working" branch and merge in from the "master" branch for real.
>
> It's probably not as complicated as it sounds, and having a separate working branches is standard GIT practice, from what I've read.
>
> Alternatively perhaps you could just merge as you are now and just roll back from the command line with "git reset" if you didn't like the result.
>
> A few ideas anyway..
>
> Regards,
>
> Rory O'Bryan
>
> On 12 Apr 2011, at 14:24, Pelaia II, Tom wrote:
>
>> Is there a way in Xcode to see which files will be updated in a git repository prior to a "Pull" command? When I perform a "Pull" command within Xcode, it simply updates all the files without telling me which ones it will update prior to the update unless there is a conflict. Unlike with SVN, I never see that files are awaiting update. I can only see which files it pulled after the fact by visiting the organizer. _______________________________________________
>> Do not post admin requests to the list. They will be ignored.
>> Xcode-users mailing list (email@hidden)
>> Help/Unsubscribe/Update your Subscription:
>>
>> This email sent to email@hidden
>>
>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden