cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Your Friends List is a way to easily have access to the community members that you interact with the most! X

.gitattributes and .gitignore

ClayHelberg
17-Peridot

.gitattributes and .gitignore

Hi folks--

We are moving to source control with Git, and I've discovered that, by default, Vuforia Studio inserts some Git control files, .gitignore and .gitattributes, in each project folder. Is there a way to remove or modify the defaults for these files? Our repository doesn't support LFS, but the Git files in all the projects are trying to use LFS, which means I can't put projects under source control without having to go in and modify those files.

--Clay

5 REPLIES 5

Weird timing. I just moved all my studio work into git yesterday and appreciated that those files were there by default, particularly the .gitignore. However my repo (Azure DevOps) supports LFS so I didn't have this problem.

 

I'll be interested to see an answer though as setting the defaults could be useful.

 

One issue i did find today is that if you use the "Save As" button on the Studio project page it copies the entire project folder including the .git directory. This will tie your saved copy back to the same remote and branch as what you copied from. If you make changes to the copy project and then push them they are going to the old project repo by default.

 

So if you use the "Save As" button the immediate next step needs to be deleting the .git folder and then add, commit and push to the correct remote.

sdidier
17-Peridot
(To:jmikesell)

Hello Clay and Mike,

 

I have searched in my laptop to see if these files are copied from a template or if it is hard coded in Javascript source code.

In Vuforia Studio .appx bundle, I was not able to find these files.

 

In .gitattributes file, I was able to comment all lines and to save Project in Vuforia Studio without any impact.

 
# Denote all files that are truly binary and should not be modified.
# *.pdf filter=lfs diff=lfs merge=lfs -text
# *.pvz filter=lfs diff=lfs merge=lfs -text
# *.gltf filter=lfs diff=lfs merge=lfs -text
# *.png filter=lfs diff=lfs merge=lfs -text
# *.bmp filter=lfs diff=lfs merge=lfs -text
# *.jpg filter=lfs diff=lfs merge=lfs -text
# *.gif filter=lfs diff=lfs merge=lfs -text
# *.mp3 filter=lfs diff=lfs merge=lfs -text
# *.mp4 filter=lfs diff=lfs merge=lfs -text

 

Another solution might be in .gitignore file, remove ! before .gitattributes entry :

#-- BEGIN OOTB GITIGNORE --#
# Do not modify contents between BEGIN and END, it will be replaced on upgrade
#-- ignore everything
/*
#-- unignore files that should be source controlled
.gitattributes
!.gitignore
!appConfig.json
!/src/
!upgrade*.log
#-- re-ignore default resources
/src/phone/resources/Default/**
#-- END OOTB GITIGNORE --#

 

Note that as explained by comments in .gitignore file, when updating to a new version of Vuforia Studio, these files will be modified.

It seems at the end of file, we can add custom settings without any impact when doing Vuforia Studio update.

 

When publishing .git folder is not copied in Vuforia Experience Service.

When doing a Share > Export Project, .git folder is in the zip archive but not the gitignore and .gitattributes files.

 

So, I have opened this case 17008687 and reported this JIRA Ticket VTS-1670 to R&D to have more details about to manage git and these files with a Vuforia Studio project.

 

I will come back to you when I will have more details.

 

Best regards,

Samuel 

sdidier
17-Peridot
(To:sdidier)

Hello Clay and Mike,

 

Some news from R&D, .gitignore and .gitattributes files are hard coded in Vuforia Studio.

It needs an enhancement to have template files to allow to modify default settings when creating a new Project.

 

When doing a Share > Export Project, .git folder is in the zip archive but not the gitignore and .gitattributes files, it needs an enhancement also.

 

For both of these ideas, I can contact Product Manager if you want. Please reply to this thread to inform me if you agree or not.

 

About update of  gitignore and .gitattribute file when moving to a new version to Vuforia Studio, as normally, in a such case, Project has been initialized previously with git repository, if files are modified by update, we can revert back or not commit changes on them.

So, it should be a problem.

 

Best regards,

Samuel

Hi Samuel--

 

Yes, I agree, it would be nice to have better handling of the git config files and metadata, especially when exporting projects and duplicating them.

 

--Clay

Hi all,

I want to implement Source Control on our Vuforia Studio projects via Git on a GitLab repo (I've to check if it supports LFS but I'm pretty sure it does), and found this post searching for Source Control best practices.
I was thinking to use the "Export Project" package as a clean base, but after reading this post I'm a little confused about the .gitattributes .gitignore files.
Could you advise me what is best to save/include in commits to avoid too much redundancy?


Thank you in advance.

Top Tags