2

I followed this guide:http://www.raywenderlich.com/41377/creating-a-static-library-in-ios-tutorial to create a static library and added it as a subproject to my main project.

When I tried to push after committing(Source Control->Push), I see my static library in addition to my main project included in the push.

I want my static library to be part of my project and only push to 1 remote repository.

How can this be done?

Problem

CodeWizard
  • 128,036
  • 21
  • 144
  • 167
iamarnold
  • 705
  • 1
  • 8
  • 22
  • do you have a ```.gitignore``` file? – Anand S Jan 05 '16 at 20:12
  • `I want my static library to be part of my project and only push to 1 remote repository.` Could you try to explain this another way? `part of my project and only push to 1 repository` doesn't match with the way that git works, but I want to make sure we're on the same page. – Guildencrantz Jan 05 '16 at 20:19
  • @Guildencrantz I added a screenshot. I added my static library as a subproject of my main project. When I commit and push, I want to push everything to main project's repository. – iamarnold Jan 05 '16 at 20:39
  • @AnandS I have a .gitignore file, but I want my static library to be included in my main project's repository when I push, not a separate repository. – iamarnold Jan 05 '16 at 20:41
  • click the checkbox of the static library and push, I guess it will be added to your main repository not as a separate repository. – Anand S Jan 05 '16 at 20:48

1 Answers1

2

I want my static library to be part of my project and only push to 1 remote repository.

Adding them to .gitignore if they are already tracked.

You should use the assume-unchanged flag
https://git-scm.com/docs/git-update-index

--[no-]assume-unchanged

When this flag is specified, the object names recorded for the paths are not updated.
Instead, this option sets/unsets the "assume unchanged" bit for the paths.

When the "assume unchanged" bit is on, the user promises not to change the file and allows Git to assume that the working tree file matches what is recorded in the index. If you want to change the working tree file, you need to unset the bit to tell Git. This is sometimes helpful when working with a big project on a filesystem that has very slow lstat(2) system call (e.g. cifs).

Git will fail (gracefully) in case it needs to modify this file in the index e.g. when merging in a commit; thus, in case the assumed-untracked file is changed upstream, you will need to handle the situation manually.

enter image description here

CodeWizard
  • 128,036
  • 21
  • 144
  • 167