Laravel - views folder getting deleted repeatedly - laravel

Using Laravel Framework 5.5.0.
The /var/app/current/storage/framework/views folder is constantly getting deleted.
Has anyone experienced this behavior or know why this would be happening?
*Also worth noting I attempted to circumvent this by setting the immutable flag on the directory but then my frontend stoped working.

Looks like the folder is getting deleted because there is no files tracked by git inside.
Try to add .gitignore to the storage/framework/views with the following content:
*
!.gitignore
Then remove all gitigore rules for views folder in root .gitignore.
You should be able to add this file to git index and commit. The problem should be fixed after next deploy.
See: How can I add an empty directory to a Git repository?

Related

How Disable Locked Files in 8.1 without encryption key

I delete my unity project which has a .git folder and ask me to create an encryption key I don't know why it asks me to do that, now when I try to add files in git it refuses to add any things and it prompts this error
The file will have its original line endings in your working directory
error: open("Temp/UnityLockfile"): Permission denied
error: unable to index file 'Temp/UnityLockfile'
fatal: adding files failed
Any suggestion
In general the Temp folder is one of the things you do NOT want to be under version control! It should be ignored as mentioned by the first comment! Use this .gitignore file in the root folder of your git project!
Also see Cleaning up and Migrating existing Unity project into new one or another PC where I explained it a bit more in detail and also how to copy your project with only the necessary files.
As said if there is no such file yet simply create it, otherwise adopt the content accordingly.
Also refer to How can I make Git "forget" about a file that was tracked, but is now in .gitignore?.
In your specific case here the error itself is caused because you currently have your project opened in Unity.
In that case there is the - as the name says - LOCK file which ensures you cannot open the same project twice in a second Unity instance.
This file is locked/owned by the Unity Editor process itself and therefore can't be overwritten/accessed by git at the same time.
Now if for some reason after adding the .gitignore file mentioned above this issue still persists you can close Unity, manually delete the Temp folder, make your git merge and reopen Unity.

Laravel git ignoring images uploaded to storage

I'm running into an issue which i haven't been able to solve yet.
I was working on a laravel project and than moved this project folder to a newer version of MAMP. So far so good, everything was working fine. I just copied all the folders and files and all was good until i logged in to my laravel application on localhost and uploaded some images.
I know i can do this on my host but i like to work on localhost to add content and than push it to my prod env. Anyway, after i uploaded some images and did a git add . and commit it didnt add my uploaded images, on phpstorm they also turn out red in the storage/app/public/images folder.
On my previous mamp version everything used to work fine.
Stuff I have already tried:
I tried deleting the symlink storage folder and make a new link, didn't help.
I tried deleting the storage folder from gitignore, also didn't help.
My gitignore file looks like this:
/node_modules
/vendor
/public/hot
/public/storage
/storage/*.key
.env
.env.backup
.phpunit.result.cache
Homestead.json
Homestead.yaml
npm-debug.log
yarn-error.log
/config/database.php
/public/sitemap.xml
When i login on my prod env and i upload images, they turn up fine, but i prefer sometimes to work from localhost to write content and push it to env.
I have also tried to:
git check-ignore -v -- path/to/file
To check why the file (image) is being ignored but it doesnt return anything.
I got one time a message with: Fatal: pathspec ... is beyond a symbolic link.
I hope someone can push me into the right direction. Thank you.

Cmder seems to be broken after git push, how can I fix the clink.lua?

I'm working in a group using GitHub, and when I tried transferring my work to the remote repo it didn't allow me to. It says I must do git pull first, so I did. That created some conflict in my code, then I tried to do git push again and that didn't work either.
So I switched to a new branch and tried to push from there. Didn't work with a simple git push, but a similar instruction worked for me.
Since then cmder keeps showing this:
C:\laragon\bin\cmder\vendor/clink.lua:219: attempt to index local 'HEAD' (a nil value)
C:\laragon\www\pharmacie>
Which allows me only to use instructions like php artisan serve, but not Git instructions like git status...
I already tried some clink.lua code that I found on github, but didn't work.
I tried abandoning my project, so I cloned the remote repo locally.
But then it didn't clone the vendor folder or the .env file; so I added them from an other repo (so it could compile) and changed the DB name in the .env file to match my project.
Now it keeps giving an error that says the table of the project I got vendor + .env from doesn't exist. But I didn't leave that table in the .env, I changed it to my project.
Any help?
Your problem is probably due to a conflict in a file you didn't handle.
When there is a conflict, a file usually looks like this:
<<<<<<<<< HEAD
// Some code
==============
// Some other code
>>>>>>>>> branch
And you have to choose what you want to save and what you want to delete after the merge.
So I would recommend to you to check your C:\laragon\bin\cmder\vendor/clink.lua file at line 219 to see if it could contain what I just said above.
And by the way, you should add your vendor folder in your .gitignore
And for the problem with your .env file, did you run php artisan migrate ?
EDIT
And because the problem come from your vendor folder, you could resolve it by deleting your vendor folder and run composer install to reinstall your dependencies
I have been facing the same issue. I resolve the issue by updating the cmder.
As like the image above for that click on the upper right corner (Setting) on the cmder window.
1. Choose: General -> Update
2. Check the Startup checkbox for (Do automatic check on) and then
3. Click the save settings button
4. Restart the cmder.
5. It will prompt for update and allow it to update.
6. Restart cmder again and it will resolve the issue.
I repair it as follows:
clone the repository again into another folder
access the hidden .git folder and copy only the folders (hooks, info, logs ...), do not copy the files
replace the folders in the .bin folder of the newly cloned project with the old one
with this I recover the branches and the code of my project, I hope and it will be useful to someone.

Cannot commit to Git repository in Xcode 6.0.1

When I try to commit I get the following error:
The working copy "Chord Attack" failed to commit files. fatal:
Will not add file alias 'Chord Attack/GameResources/GUI/Chord Attack/chordattackbg.png'
('Chord Attack/GameResources/GUI/Chord Attack/ChordAttackBG.png' already exists in index)
I can't even find that file in my directory or anywhere on my computer. I deleted that from my project a long time ago. I even recreated my project and manually added files one by one and some how this happened again. I saw another post that said to delete the file and manually re-add it, but it didn't work. Currently, the chordattackbg.png file is in my project. I tried deleting that and then committing, but the same error came up. What am I doing wrong?
This is a case issue (chordattackbg.png vs. ChordAttackBG.png), as described in this question.
You would need to:
git mv ChordAttackBG.png foo
git mv foo chordattackbg.png
git commit -m "Rename ChordAttackBG.png to chordattackbg.png"
Then you would apply your modifications to chordattackbg.png, add and commit.
Here the solution was to:
clone the local repo again,
cleanup its content,
rename the file (ChordAttackBG.png to chordattackbg.png),
add the new modifications to chordattackbg.png,
re-open the project in XCode from the new clone.
I solved this problem deleting this file:
/path/to/project/folder/.git/index.lock
Then I could commit from Xcode with no problems. Hope this helps!

Subversion control No Such file or directory. Can't open file

Error message :
"svn: Can't open file '/Users/username/Projects/myproject/trunk/project/.svn/text-base/filetoupdate.h.svn-base': No such file or directory"
Question:
I have an issue I've replaced a file in a project (in Xcode) with a new file (For reference and if this makes a difference, the new file has the same name as the one I deleted previously).
Now when I try to commit my changes in Xcode I get the error message detailed above and am unable to commit the changes (i.e. adding the new file).
In the file system view (in Xcode on the left hand side of the screen) the file has an R next to it (indicating Replaced in the repository).
Does anyone know how to fix it so I can commit the files?
Thanks
There is a bug or limitation in Subversion when using case-insensitive filesystems:
https://superuser.com/questions/303348/cant-checkout-in-subversion
This bug normally shows up when checking out a repository that contains two files whose names differ only in case. Of course, these cannot exist at the same time in the same directory on a case-insensitive filesystem. SVN could give a much more helpful error message, but it can't really solve the problem.
Your issue is a bit different because I assume the file filetoupdate.h (with the old case) no longer exists in your filesystem. So it's not a case conflict in the working directory. But I guess that SVN is trying to create the file in .svn/text-base with the new case, while the old one still exists, and that is failing (for the same reason).
You could try deleting the file from Subversion first, keeping the local copy (untested). The new copy must be removed from SVN control for the commit to succeed:
svn rm --keep-local --force FileToUpdate.h
And the old copy must be removed as well, to allow us to add the new copy later:
svn rm --keep-local filetoupdate.h
Commit this change:
svn commit
Now hopefully you can add the new file to version control:
svn add FileToUpdate.h
If that doesn't work, you might need to blow away the whole checkout and start again with a fresh one.
Are you on a Mac or Windows? Those have case-insensitive filesystems which causes the above problem when
a file currently exists with the same name but with different cases.
To fix , checkout out the tree on a Linux machine, then "svn rm" one of the files.
Maybe your local version has permission issues. Check if your user have the permissions to write for the .svn directories.
good luck
It looks like something got confused somewhere. To fix, I simply copied the offending files, saved them under a new name. Removed the originals from the project and the added the copied (renamed) version of the file to the project.
It seems to be that SVN doesn't like it if you add and remove a file with the same name. I tried cleaning the SVN through terminal, but it had no affect on this issue. But changing the name did work for me.

Resources