Hello there,
I am using mojostratus hosting and have built up our site using Magento 2.3.4, Porto theme and various extensions. One thing I should have thought about was dev/prod staging using git. I wasn't working on it locally, just SSHing in when I needed to. Can someone please help me understand the workflow here? I'm relatively familiar with git and have used it on many other projects, just not with Magento 2. When I input git status through SSH, I get "fatal: not a git repository (or any parent up to mount point /)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set)", so I'm assuming I need to initialize and create an empty repo to connect it to? All of the docs I've seen about this topic are related to cloning the master Magento 2 from their github to local and then going from there. My guess would be that I need to git init-connect to empty repo-clone to local(develop here)-create development branch on github- merge to my master branch when wanting changes to go into production-pull from mojostratus SSH. Am I close here?
Thanks for the advice,
Dan
Hello @dandanjome3465
It's because you have not setup git in your project, you must run :
git init
then git will be initialised and then you need to add your repository.
later you should exclude vendor directory in your git (manage it via .gitignore) and don't push files which have local use, for ex: app/etc/env.php because that stores project specific values.
you can take reference from here :
https://devdocs.magento.com/cloud/reference/git-integration.html
Hope it helps !
Thanks for the reply. The link to the docs you sent is for if a project is hosted on Magento's Commerce Cloud, right? Our site is hosted on Magemojo and is using the open source(community) version of Magento 2.3.4. I think this makes a difference here. So, do you suggest that I initially make a repo and push everything without a .gitignore, then clone to my local machine? Can I use the Magento Cloud CLI without magento cloud commerce to create the different staging environments? I was under the impression that this will cost extra money and is part of a different plan. Still pretty confused and would love more advice!
thanks
Ignore the reference as it's for commerce cloud, do these steps :
1. create a repo on github.com .
2. run this command on your project setup : "git init" .
3. then you'll have all local changed files.
4. add github repository by command : "git remote add origin remote repository URL"
5. add the needful directories and files and push
That's it !
thanks @gaurav_harsh1
so, to recap, my project is currently on Magemojo, I do not have a local version yet. You suggest I make a repo from the hosted destination and then pull it to my local machine and create a dev branch, right?
Will I still be able to connect to the online magento database if I run it locally?
Yes, but the steps I share above will push the code to your repo with a master branch, then you will need to pull that master clone on local and then you can create branch from master branch, then you can manage it from local and live but DATABASE is not part of git, you have to take care of that, whatever changes you will do in admin on local, most of them will not be covered in git.
You have to manually change on live.
Ok, so a local production environment is mostly for any front-end programming related development, correct? If I won't be doing much customization, what is the point of a dev environment then?
Thank you very much; I solved the problem with your comment. I see very weak marketing campaigns to promote brands on the Internet everywhere now, and I don't understand why things are exactly like this if this is currently in maximum demand on the market. The only thing I like is how Shopify Website Development works. These guys seem to know what they are doing and why, as I constantly see the fruits of their labor and the success of the businesses they promote.
A debt of gratitude is in order for the answer. The connect to the docs you sent is for assuming that a venture is facilitated on Magento's Commerce Cloud, correct? Our site is facilitated on Magemojo and is utilizing the open source(community) form of Magento 2.3.4. I think this has an effect here. Anyway, do you recommend that I at first make a repo and push everything without a .gitignore, then, at that point, clone to my neighborhood machine? Would I be able to utilize the Magento Cloud CLI without magento cloud trade to establish the different arranging conditions? I was under the feeling that this will cost additional cash and is important for an alternate arrangement. Still beautiful befuddled and would cherish more exhortation!
Alright, so a neighborhood creation climate is for the most part for any front-end programming related turn of events, right? In the event that I will not be doing a lot of customization, why bother of a dev climate then, at that point?