Share your Xcode projects(XCode连接Visual Studio Online|TFS Service)

Share your Xcode projects in Visual Studio Online using a Git repository. Or, if your team project uses TFVC instead of Git, you can use the git-tf command line tool to check your files into Visual Studio Online.

Enable alternate credentials

To use Git with your Visual Studio Online account, enable alternate credentials so that you can sign in from Xcode.

  1. Sign in to http://visualstudio.com and open your profile.

    Team project home page, my profile 
  2. Allow alternate credentials for this account.

    Enable alternate credentials link on user profile page 
  3. Use a secondary user name that isn't an email account. Xcode can't use the primary user name because of the @ character.

    Alternate credentials enabled in the user profile page 

Clone the repository

  1. If your team doesn't already have a team project that uses a Git repository for version control, create one.

  2. Go to your repositories root and clone your team project repository.

    cd ~/repositories
    git clone https://[account].visualstudio.com/DefaultCollection/_git/[team project]

  3. You'll be prompted for credentials. Use the secondary user name from your account's alternate credentials. (Jamal instead of fabrikamfiber4@hotmail.com, for example.)

Now you have a local clone of the Git repository in your team project. You can add your code to the local repository, and push your commits to share them in Visual Studio Online.

Add your code to the repository

  1. Move your code into the local Git repository.

    In Finder, moving code folder to repos/team-project
  2. In Eclipse, commit your changes locally.

    Source Control menu, commit
  3. Push your changes to your team project's repository.

    Source control menu, push

Q&A

Q:Where can I find the URL for my Visual Studio-managed Git repository?

A:It's in the team project home page, in the code explorer.

  1. Open the code explorer on your you team project's home page (https://[account].visualstudio.com/DefaultCollection/[team project]).

    Team home page, code explorer 
  2. With the repository you want to clone selected, get the URL.

    Team project home page, code explorer, clone icon selected to show the URL

Q:Can I add my local Git repository to the team project?

A:Yes, as long as your team project is set up to use Git for version control (instead of TFVC), you can add as many repositories as you need.

  1. Go to the repository you want to add and define the remote origin.

    cd ~/repos/[repository]
    git remote add origin http://[account].visualstudio.com/DefaultCollection/_git/[repository]

  2. Push your repository to your team project.

    git push -u origin --all

Q:Should I use Git or TFVC for my team project?

A:That depends on a number of factors, like the size of your codebase and the size and distribution of your team.

Q:If my team project uses Team Foundation Version control, can I still share my Xcode projects in Visual Studio Online?

A:Yes, use the Git-tf command line tool to push your changes from the local Git repotory to TFVC.

Download and configure Git-tf

  1. Download and extract Git-tf.

  2. Add Git-tf and the Java runtime to your path.

    export JAVA_HOME=/Library/Java/Home
    export PATH=$PATH:$JAVA_HOME/bin:/git_tf

  3. Go to the root of your local repository.

    pushd /ws/FabrikamFiber

  4. To share your Git repository in Visual Studio Online, configure the connection and check in your code. You'll be prompted for credentials.

    git tf configure https://fabrikamfiber.visualstudio.com $/FabrikamFiber
    git tf checkin

    Or, if your team's code is already in Visual Studio Online, you can clone a local repository using Git-tf.

    git tf clone https://fabrikamfiber.visualstudio.com $/FabrikamFiber

  5. If you don't want to be prompted for credentials every time you run Git-tf, you can store your credentials in your Git configuration.

    git config git-tf.server.username fabrikamfiber4@hotmail.com
    git config git-tf.server.password mypassword

Share your code

  1. After you commit changes to your local Git repository, and you're ready to share them in Visual Studio Online, check them in.

    git commit -a
    git tf checkin

    If you've committed multiple changes locally, you'll still get just one changeset in Visual Studio Online.

  2. Resolve a bug or close a task when you check in by providing the work item ID with the resolve flag.

    git tf checkin --resolve=21972

    The changeset and the work item are linked, and you'll be able to see which bugs are resolved and which tasks were completed in the build reports.

  3. You can make sure you're working with your team's latest code by pulling from Visual Studio Online.

    git tf pull

    Use git tf help to learn about the Git-tf commands.

    git tf help
    git tf help

转自:

http://www.visualstudio.com/get-started/share-your-xcode-projects-vs


  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值