简体   繁体   中英

Adding a git repository to Xcode 4

When I add an existing repository to Xcode (using "Add Working Copy") I get the error message "Unable to load revisions".

Any suggestions on what to do?

From your question, I'm assuming you do not have a remote repository and only a local one?

If so, I had this problem many times as well, and no matter what I did, Xcode wouldn't recognize my git revisions. So, I simply restarted Xcode in frustration and it worked. Hopefully its as simple as that for you.

You know what? I wouldn't.

Xcode's "version control" interface is built to be agnostic about which back-end it's using, SVN or git. It's built for the lowest common denominator of shared features. As a result, most of the power of git is explicitly not supported within Xcode itself.

I quit using Xcode's version control completely when I realized this. I like Tower 2 for a gorgeous and Mac-ish git GUI, and the command line for most of my heavy lifting.

I'm assuming you have your repository added in Organizer. You clone the revision to a local folder where your changes are saved. You then work inside the cloned folder, committing and pushing changes up to your repository.

While I won't go so far to say don't use git in XCode, the implementation does leave something to be desired. So unless you are going to use git entirely in the command line (which learning some commands is almost going to be required to pull off after the fact git implementation), it is going to take some work.

Here is a link how to set up git in XCode by github.

XCode 4 released with git integration

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM