Tag Archives: Git

Removing Git branches by mask

When working in a team with Git, you often have to create and delete branches. If you are a terminal user like me, you can optimize branch deletion as follows. Maybe someone will come in handy, I use it all the time.

Before:

Apply:

After:

Merging Three Git Repositories Into One Repository Without Losing File History

Let’s assume that we have three separate git repos named uremont-client, uremont-service, uremont-sdk. We want to create a new repo, named uremont-ios, that contains all those repos in separate folders to have one single repo.

Why do we want to do this? In my case I had two apps and one sdk for them, and it was inconvenient for me to push changes to three separate repos while I was working with these projects and sdk at the same time.

Let’s start.

Terminal setup to allow git to move all folders except one. We will need this later.

Create a new folder uremont-ios and initialize git repo:

Add remote of first old project uremont-client that we want to merge to the new git repo and fetch it:

Merge first old project uremont-client to the new repo:

Move all folders and files of that old project to the separate folder inside of our new project:

Commit changes:

Similarly merge second old project uremont-service to the new repo:

And third:

Finally, add a new remote to our new repo and push it:

How to use a new model of CocoaPods PodSpec updates

Recently CocoaPods started to use web service to load new PodSpecs.

I will skip a moment, where you need to register your projects to yourself. Basicly, guys that manage CocoaPods have created a web service, that knows, which computer has permissions to which Pod.

But when you have done this, you have to know, how to publish new versions of your Pods. You have to create a tag and push it on a new version as before and use that tag in your pod spec file.

Then you should check your new updated pod spec.

Then you just push your pod spec to a web service. Now you do not have to create one more folder for a new PodSpec file, copy it to your Specs fork and create a pull request. Everything is much simpler!

Here it is important to tell a path to your pod spec file. I use here a dot since my pod spec file is located in the folder, where I am currently in Terminal.
For more information read a blog of CocoaPods project.

If you are asked to register a session first, do this:

In my case: