How to add local Git server account in Xcode 9?

Viewed 2761

We all know that Xcode 9 provide's so many support of Github such as clone, commit, pull, push etc. There is an option on Xcode->preferences to add GitHub account. Here is a screenshot below.

enter image description here

I can add a my Remote(public) GitHub account. We have a private Git server in our office and we access it using this ip (192.168.1.15), but I can not add this Git server account on my Xcode. I already add my personal public GitHub account(shamiul110107) shown in screen bellow.

My question is that how can I add my private Git server account in Xcode 9?

Thanks in advance.

3 Answers

@Samiul Islam Sami

In previous versions of Xcode , ie. prior to Xcode9 you can add your local Git Server account. From Xcode9 that feature has been removed and Github has been integrated with Xcode which allows you to have a control over your Github repositories within Xcode9. However you can still use your Git Server from office without adding an account to Xcode.

  1. Open Xcode
  2. Source Control -> Clone
  3. add the repository URL from your local Git Server (Here I'm using a git Repository from GitHub without adding any account to my Xcode)
  4. Press Clone and Select the save location
  5. The project will create a local repository in your PC
  6. You can add changes and commit and then push

while pushing to the local Git Server ,user credentials is required , which in your case is your username and password for your local Git Server account.

images added below:- enter image description here

enter image description here

enter image description here

enter image description here

enter image description here

enter image description here

enter image description here

enter image description here

If you already have a local repository that you need to push to a remote, you can use the command-line to add that remote:

  1. Login to the remote server and create a bare repo if it does not exist: git init --bare repo.git

  2. Close Xcode on the local machine.

  3. cd to the Xcode project directory.

  4. Add a remote: git remote add origin ssh://username@host:port/path-to-repo.git

  5. Open Xcode project. You should be able to Source Control > Push to the new remote.

You cannot add a "Git server account", and you don't need to. This has nothing to do with Accounts; you're looking in the wrong place.

If the question is how to clone from a remote repository, choose Source Control -> Clone and enter the required information. Or clone using the command line. Either way, once you have a clone, there is nothing else to do, as the clone contains the remote info.

Related