doitian / unity-git-hooks Goto Github PK
View Code? Open in Web Editor NEWGit hooks for Unity3D project
License: MIT License
Git hooks for Unity3D project
License: MIT License
Hello! I would love to use this in our project but it is missing the license type. Would you mind adding it?
In pre-commit script The cycle is designed in such a way that it always checks the existence of the Assets.meta file at the end.
git status
new file: Assets/Issue.meta
new file: Assets/Issue/TestScript.cs
new file: Assets/Issue/TestScript.cs.meta
git commit -m "testScriptCommit"
Error: Missing meta file.
Asset `Assets/Issue/TestScript.cs' is added, but `Assets.meta' is not in the git index.
Please add `Assets.meta' to git as well.
I solved the problem, but not sure what is correct. I added a condition into a while loop after 51 and 89 lines
if [ "$p" = "Assets" ]; then
break
fi
Trace log for help.
++ git config --get unity3d.assets-dir
+ ASSETS_DIR=E:/UnityWork/bulletshero/
+ against=HEAD
++ git status --untracked-files=no --porcelain
+ '[' 'A Assets/Issue.meta
A Assets/Issue/TestScript.cs
A Assets/Issue/TestScript.cs.meta' == '' ']'
+ exec
+ echo -e '\e[32m[RUN] start checking .meta files \e[39m'
[RUN] start checking .meta files
+ git diff --cached --name-only --diff-filter=A -z HEAD -- E:/UnityWork/bulletshero/
+ read -d '' f
+ ext=meta
+ base=Assets/Issue
+ '[' meta = meta ']'
++ git ls-files --cached -- Assets/Issue
++ wc -l
+ '[' 2 = 0 ']'
+ read -d '' f
+ ext=cs
+ base=Assets/Issue/TestScript
+ '[' cs = meta ']'
+ p=Assets/Issue/TestScript.cs
+ '[' Assets/Issue/TestScript.cs '!=' E:/UnityWork/bulletshero/ ']'
++ git ls-files --cached -- Assets/Issue/TestScript.cs.meta
++ wc -l
+ '[' 1 = 0 ']'
+ p=Assets/Issue
+ '[' Assets/Issue '!=' E:/UnityWork/bulletshero/ ']'
++ git ls-files --cached -- Assets/Issue.meta
++ wc -l
+ '[' 1 = 0 ']'
+ p=Assets
+ '[' Assets '!=' E:/UnityWork/bulletshero/ ']'
++ git ls-files --cached -- Assets.meta
++ wc -l
+ '[' 0 = 0 ']'
+ cat
Error: Missing meta file.
Asset `Assets/Issue/TestScript.cs' is added, but `Assets.meta' is not in the git index.
Please add `Assets.meta' to git as well.
+ exit 1
+ ret=1
+ '[' 1 '!=' 0 ']'
Thank you.
when rename a directory, and without create a meta file.
pre-commit can not prevent this case.
for example:
.vscode
if i want share vscode config in team, i must create the meta file manually. otherwise, i can't push a commit.
the meta file will not generate automatically by unity.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.