Creating private cocoapods repo outside github - ios

We are working on projects which use both open-source libraries and our private libraries which can't go public. By public I mean, that they can't be hosted outside our company servers. We would like to use CocoaPods for all of them. While using open-source libs is pretty easy, my question is if I can use private repository on our private servers to host our private libs? I've found this link http://guides.cocoapods.org/making/private-cocoapods.html, and there is no information weather it has to be github or it can be any server, however I was also looking for solution on other pages and everybody say that I has to be repo on github. Is it true?

It does not have to be a repo on GitHub. See the private pods guide for more info.

Just add a new local repo and configure the remote as needed:
mkdir ~/.cocoapods/repos/private
cd ~/.cocoapods/repos/private
git init
git commit -m Initial
git remote add origin https://myremote.org
git push -u origin master

Yeah, you can use any git repo you want.
I always follow this tutorial when create private cocoa pods.
https://coderwall.com/p/7ucsva

it's simple
write the following lines
mkdir ~/<path x>
cd <path x>
git init
pod repo add <name of your repo> ~/<path x>

Related

Git Version controls tutorial for Xcode projects

How to manage my Own project on server using Git version control.
Is there any tutorial for creating Server and adding project using Git commands.
I don't completely understand what you mean by creating server.
But if you mean creating a repository, then what you can do is go to one of the following websites and create a free account based on your need:
Github: https://github.com
Bitbucket: https://bitbucket.org
Now the above two have following features:
Github support unlimited free public respositories, and paid private repositories.
Bitbucket supports unlimited free private repositories.
You can start with creating a free account. Then go to your project repository root folder and execute the following commands in the same order:
for instance using bitbucket: -
git init
git remote add origin git#bitbucket.org:username/abc.git
echo "Anil Gupta" >> contributors.txt
git add contributors.txt
git commit -m "Initial commit with contributors"
git push -u origin master
Thereon you can follow this tutorial:
https://www.tutorialspoint.com/git/git_tutorial.pdf
Cheers!

How to get dependencies which are not on github through Carthage?

I am trying to use only carthage for dependency manager. But what happens if the project is not available on github? What is work through for that?
Thanks
Using an example on Bitbucket you can do the following:
Setup SSH keys for the acct
use the direct ssh sync
git "git#bitbucket.org:{acct}/{repo}.git"
In general that line can be used for any repo.
git "http://git.mypersonalserver.net/mySource/myrepo.git"

Split up Git Repository

I have a git repository that contains two directories:
src: A full Rails app
devbox: Files to build a vagrant machine and provision using an Ansible script
I wish to split these out to two separate repositories so I have one solely containing my app and another containing the vagrant devbox.
This SHOULD allow me to add the app repo as a git submodule inside the devbox one in order to be worked on but at the same time allow Capistrano to grab the source from the app repo without any faffing around to only get a subdirectory of the full combined repository.
Any thoughts about how to go about splitting the current repo up? I'm just a bit unsure where to begin.
move the devbox folder out of the repo.
mv devbox ~/Projects/
move the src folder out of the repo.
mv src ~/Projects
create two empty repos on your github account for both devbox and src
initialize devbox as git repo cd ~/Projects/devbox && git init
Add the git remote. Instructions provided when you created the git repo on github. git add remote ...
Push the repo to github git commit -am'initial commit' && git push origin master
Repeat steps 4-6 for src

Transferring code from github to my own git server

I have some rails code that is hosted on a private github repo however I want to move that code to my own git server and do away with github. I have a server and git setup already, however if I do a git clone (github location) wouldn't that still be using github as a remote? What is the proper way to do this?
A git clone is a complete copy of the remote repository.
You can use git clone --mirror on your private server, in order to set up an exact mirror of the remote, followed by git remote rm origin to remove references to the original (however this is not necessary for it to function properly).
After this, all you have to do is clone the repo from your new, private source, instead of github.
(You can also use git clone --bare instead; Differences between --bare and --mirror are explained here).

Where to place Git repository

I just started using Git and I want to know if this is the right way of using it. I started a Rails app with:
rails newapp
Then I did:
cd newapp
git init
git add .
git commit -a
So is it "right" to init my git inside my working directory?
Yes. You can place a git repository anywhere - including the invisible .git directory created by another git repository. I have a friend who has git track all his system config files in case he makes a mistake.
When working on a project, you want to init your repository in the root directory of the project.
To elaborate, each "working copy" of a Git repository is itself a Git repository. If you have a remote copy on a server, that is also a repository. You don't "check out" from there - rather, you "push" your changes and they are merged. If working on a purely personal project, the remote repository is often unnecessary. If you do want to host remotely, Github is a good, free, public choice.
Yep. Looks good to me.
Yes. In a DCVS like git, your working copy is your repository.

Resources