1

Make once init of my laravel 8 app on server(ubuntu 20) I need to upload some images under storage, which is excluded from git by .gitignore rules.

I do not like to remove .gitignore at all, but if there is a way to exclude these rules only once ?

Seems there is some force option, but how can I use it running command locally :

git push -u origin master 

and on server :

git pull origin master 

?

My root .gitignore:

# These are some examples of commonly ignored file patterns. # You should customize this list as applicable to your project. # Learn more about .gitignore: # https://www.atlassian.com/git/tutorials/saving-changes/gitignore # Node artifact files node_modules/ dist/ # Compiled Java class files *.class # Compiled Python bytecode *.py[cod] # Log files *.log # Package files *.jar # Maven target/ dist/ # JetBrains IDE .idea/ # Unit test reports TEST*.xml # Generated by MacOS .DS_Store # Generated by Windows Thumbs.db # Applications *.app *.exe *.war # Large media files *.mp4 *.tiff *.avi *.flv *.mov *.wmv /public/js/laravel.app.js /public/js/oneui.app.js /public/js/tables_datatables.js /public/css/oneui.css composer.lock package-lock.json .env vendor/ route_list.txt 

Which is correct syntax ?

Thanks!

5
  • Can you add your .gitignore file? Commented Jan 7, 2022 at 14:25
  • Plase check my root .gitignore. Do you to see some other .gitignore ? Commented Jan 7, 2022 at 15:00
  • Your question is not quite clear. Do you have some more .gitignore files ? Commented Jan 7, 2022 at 16:22
  • Maybe in subdirectories of the project there are. But now I have default rules that files under /storage are not pushed/pulled by git. I need to ignore these rules only once Commented Jan 7, 2022 at 16:27
  • This might help you stackoverflow.com/questions/52275676/… Commented Jan 7, 2022 at 16:28

1 Answer 1

0

Looks like adding -f key like:

git add -f storage/app/public/Photos/1/img-13.jpg 

works in my case

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.