I have a git pre-commit hook script to validate certain thing during commit.
This in my script .githooks/pre-commit
#!/bin/bash
echo "Here I am!"
This is the file permission
In ubantu when I am committing anything I am able to view the echoed message, where as when I doing the the same thing in MacOS I am getting this error
fatal: cannot run .githooks/pre-commit: No such file or directory
git config is .git/config
line break type is CRLF
Also when I am directly running the file (in MacOS) from CLI like this, it is giving me the desired output.
./.githooks/pre-commit
My git version is 2.32.0 (Apple Git-132)
could you please try this and see if it's working for you?
brew link --overwrite git
brew update git
You should have the latest version of git -> 2.35.x
Now go to your local repository, i.e. the project folder, and then to the .git/hooks directory under your project folder.
You can place your hook files here. I.e. for pre-commit, the file name should be pre-commit (without any extension).
This should work whenever you try to commit to that specific repository. The main problem in your case seems to be the directory. The hooks should be in the .git/hooks directory of the project folder.
See the screenshots below.
I've followed all the proper steps to installing cocoapods and Firebase to my app, but for some reason, I keep getting the same Shell Script Invocation Error:
/Users/Guest/Library/Developer/Xcode/DerivedData/NewApp-eszjuaizunqxaofbuqgmicbnvqkh/Build/Products/Debug-iphonesimulator/NewApp.app/Frameworks/GoogleToolboxForMac.framework: No such file or directory
For this reason I cannot build and run my app. I've searched and followed all suggestions I could find, but nothing has worked. So far I have updated my pods, deleted Derived Data, and deleted everything from the pods to my project and restarted using my backup file.
Can someone pleeease help?
This is a pretty common that happens a lot when using Firebase with Xcode! I assume that you are using CocoaPods to download the correct frameworks. A could of things to try:
1. In Xcode go to the top bar and go to: Product -> Clean
2. Just restart Xcode! (Make sure that all Xcode related tasks aren't running) Command + Q then make sure that its no longer in your dock running
3. Go into terminal and run these commands to redownload your pod files
pod deintegrate
pod clean
pod install
If these don't work just continue trying these steps and it will probably hopefully work
Deleting the file and starting from scratch solved my issue
I get this error warning: templates not found /usr/local/git/share/git-core/templates when I cloning repo in local repository this link, this link, and this link I tried this method and I just waiting more than 20 minutes but repo doesn't clone. I use source-tree and OS X El Capitan. How can I fix it?
Create a templates folder.
In your case, it should be: mkdir /usr/local/git/share/git-core/templates
I was also getting same error
warning: templates not found /usr/local/git/share/git-core/templates when I cloning repo in local repository then i found solution which solved my issue.
I Added the [init] section to .gitconfig in home directory, so that it looked at SourceTree's git templates directory when cloning a repo:
[init]
templatedir = /Applications/SourceTree.app/Contents/Resources/git_local/share/git-core/templates
Hope it will help you!.
In case of Source tree on macOS
Steps:
Source tree Menu
Preferences
Git
Click on System Git under Embedded Git Version 2.2.1
Reset to embedded Git
Restart source tree
Similar to Rohit's answer, I went into SourceTree's Tools->Options->Git and selected "Update Embedded Git". After the latest Embedded Git version was installed, the warning stopped occurring.
Cloning via SourceTree for Mac, the download was stuck at 99% and I was getting the same error:
warning: templates not found /usr/local/git/share/git-core/templates
I started looking up the issue and found this Question. Was about to start with some of the Answers here...
But then it finally completed. So, my Answer: wait a bit longer. Mine was cloning for 10 minutes or so.
#wonderfulthunk's comment works for me:
sudo mkdir -p /usr/local/git/share/git-core/templates && sudo chown -R my_username /usr/local/git
I followed below steps and I am able to get through this issue in Windows 10.
Step1:
First know the path of %USERPROFILE% using below command in command prompt.
echo %USERPROFILE%
Please note that, you can also run git config --list and look for init.templatedir for the path.
Step2:
Look for .git_template folder in it.
If is missing, please run below command to add it.
git config --global init.templatedir "%USERPROFILE%.git_template
Step3:
Create a folder namely templates in it.
After creating this templates folder, I did not get the warning mentioned i.e. 'templates not found' any more.
MacOS: Ventura 13.0 /
Sourcetree: 4.2.0
I fixed warning: templates not found /usr/local/git/share/git-core/templates by going to "Sourcetree preferences -> Git" and clicking to "Use System Git". There's no need to restart Sourcetree, just try to clone again.
I didn't switch to usage of embedded Git again, all works perfectly with usage of System Git.
In my case, this happened because an unaccesed project. Check that you have all the privileges to clone that repository.
If you use Sourcetree application, switch git version from "Embedded Git" to "System Git" in setting.
https://community.atlassian.com/t5/Bitbucket-questions/About-git-path-for-Sourcetree/qaq-p/186483
And after changing git version, if you still have problem with cloning, change protocol from "ssh" to "https".
I couldn't get past this problem. Even after getting rid of the 'templates not found' error by adding the usr/local/git... folder, the clone would still look like it was at 99% and sit there for HOURS. I just clone via command line and it's there in seconds, then I just add the local repo to Sourcetree instead.
I'm improving the continuos integration of a project. And we decided to take an extra step and start using cocoapods. All the rvm installation is legacy and indeed I have a lot of troubles installing ruby 2.2.0. The thing is that, when I test my build script using terminal it works fine, but when I try to run them without opening a terminal window (called from applescript, jenkins or another ruby script). The command is not found.
Already tried adding the path to .rvm/scripts to the PATH variable in both .bashrc and .bash_profile
Have you try to reconnect the server after you installed the cocoapods? sometimes it doesn't see the new vars till it disconnected and reconnected.
Also make suer that the vars that you see through the terminal are available for jenkins user. you can check that through the slave "Script Console"
If it still don't work, try to set the path in the "execute shell", just before you run the pod install.
This is how it works for me:
echo "Running pod install"
cd ${WORKSPACE}
export LANG=en_US.UTF-8
pod install
I'm using CocoaPods with a project. I ran pod install and it installed correctly. Then when I try to open the created xcworkspace Xcode displaying the error 'workspace file is locked'. I tried to unlock it but it's not working. It also didn't include some frameworks (Security.framework, MobileCoreServices.framework etc.) in workspace.
I had this problem recently. I don't know about the missing frameworks, but if you go to your project folder within terminal and modify the permissions on the project files, you should be able to open the project. I personally had to modify multiple files and folders to be able to get it to stop asking me if I want to unlock my files.
Steps that Worked for Me:
Use the terminal to go to the folder that contains the xcworkspace file. Type
sudo chmod 777 NameOfYourWorkspaceFile.xcworkspace
(Please don't literally use that file name unless that's what your xcworkspace file is called). This should change the permissions for your entire workspace, but you will still have the unlock problem with your Pods project.
From within the same directory, you can do another chmod on the Pods folder like so:
sudo chmod 777 Pods
After that, go into your Pods folder by typing "cd Pods" and then modify the permissions on your Pods.xcodeproj file as so:
sudo chmod 777 Pods.xcodeproj
Like I said previously, these permission changes were enough to get xCode to stop asking me if I want to unlock my projects. I don't know if it will be enough for you though. Hopefully it helps!
I had the same 'locked workspace' problem.
The root of my problem was that I was running sudo pod install instead of pod install.
If I ran pod install I got:
[!] Pod::Executable pull
error: cannot open .git/FETCH_HEAD: Permission denied
The problem is that running sudo pod install, the root is creating the .xcworkspace and when you open it with your user, it says that the project is locked.
What I did was change the permissions to be able to run pod install by doing:
sudo chown -R $USER ~/Library/Caches/CocoaPods
sudo chown -R $USER ~/.cocoapods
Changing these permissions, the command pod install should work and the generated .xcworkspace should not be locked.
I hope this helps someone!