Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use local git repository as a dependency? #1458

Closed
lolgear opened this issue Sep 1, 2016 · 11 comments
Closed

How to use local git repository as a dependency? #1458

lolgear opened this issue Sep 1, 2016 · 11 comments

Comments

@lolgear
Copy link

lolgear commented Sep 1, 2016

How to use local git repositories as a dependency?

Tries:

  • github "../../"
  • github "../../" master
  • github "/Users/user/Projects/Github/etc/MyProjectFolderWithGit"
  • github "/Users/user/Projects/Github/etc/MyProjectFolderWithGit" master
  • github "file:///Users/user/Projects/Github/etc/MyProjectFolderWithGit"
  • github "file:///Users/user/Projects/Github/etc/MyProjectFolderWithGit" master

Errors:

  • invalid GitHub repository identifier

Please, update Cartfile reference with solution.

@lolgear
Copy link
Author

lolgear commented Sep 1, 2016

Forgot about git and github.

@lolgear lolgear closed this as completed Sep 1, 2016
@SandeepAggarwal
Copy link

@lolgear How you have solved this issue?

@tmspzz
Copy link
Member

tmspzz commented Jul 21, 2017

@SandeepAggarwal use
git "file://path/to/git/repo.git" "branch or tag"

see: https://github.com/Carthage/Carthage/blob/master/Documentation/Artifacts.md#example-cartfile

@SandeepAggarwal
Copy link

@blender If I use
git "file://path/to/git/repo.git" "branch or tag"
I get following error:
Parse error: unexpected trailing characters in line:

If I use
git "file://path/to/git/repo.git"
I get following error:
Parse error: invalid GitHub repository identifier

@tmspzz
Copy link
Member

tmspzz commented Jul 21, 2017

Can you paste your actual Cartfile and Cartfile.resolved?

@SandeepAggarwal
Copy link

SandeepAggarwal commented Jul 21, 2017

Cartfile:

github "https://github.com/netguru/ResponseDetective.git" "develop"
github "marmelroy/PhoneNumberKit"
github "nickoneill/PermissionScope" ~> 1.0
github "andreamazz/BubbleTransition"
github "Alamofire/Alamofire" ~> 4.1.0
github "https://github.com/SandeepAggarwal/cloudinary_ios.git" "master"
github "danielgindi/Charts" ~> 3.0.2
github "file:///Users/SandeepAggarwal/My Applications/LiquidFloatingActionButton.git"

Cartfile.resolved:

github "Alamofire/Alamofire" "4.5.0"
github "andreamazz/BubbleTransition" "2.0.2"
github "danielgindi/Charts" "v3.0.2"
github "Quick/Nimble" "v7.0.1"
github "nickoneill/PermissionScope" "1.1.1"
github "marmelroy/PhoneNumberKit" "1.2.3"
github "Quick/Quick" "v1.1.0"
github "netguru/ResponseDetective" "7f7a1a8c09f42d666cf7d1286bbf5830275fbdda"
github "SandeepAggarwal/cloudinary_ios" "ea77a5a6f13bfe867c2bf987295de7095926f195"

@tmspzz
Copy link
Member

tmspzz commented Jul 21, 2017

I can see that you are specifying github and not git for your local repo

Change this:

github "file:///Users/SandeepAggarwal/My Applications/LiquidFloatingActionButton.git"

to this

git "file:///Users/SandeepAggarwal/My Applications/LiquidFloatingActionButton.git"

github should only be use if the repo it hosted on... GitHub. If it's on your local file system it's clearly not on GitHub.

@SandeepAggarwal
Copy link

Oh! I am sorry I didn't realised that but it is still not working

fatal: '/Users/SandeepAggarwal/My Applications/LiquidFloatingActionButton.git' does not appear to be a git repository
fatal: Could not read from remote repository.

@tmspzz
Copy link
Member

tmspzz commented Jul 21, 2017

Try removing the .git extension

Make sure that /Users/SandeepAggarwal/My Applications/LiquidFloatingActionButton is actually under version control.

@SandeepAggarwal
Copy link

@blender Thank you so much.

@1oo7
Copy link

1oo7 commented Dec 31, 2019

Note that if you switch from using a github link to a local file link, Carthage will now think it's a completely different dependency, and will not be able to resolve upstream dependencies upon the same thing if they normally refer to the remote link. This is because unlike CocoaPods, Carthage does not let you give a unique identifier (e.g., a name, such as "Alamofire") to each dependency, so therefore it has no way to know whether git "file:///path/to/my/sick/repo" is supposed to be an alternate source for github "https://github.com/mySick/repo" or a different, new dependency. Sad.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants