GIT
Error Initilize GIT git init --initial-branch=main
Error Initilize GIT git init --initial-branch=main
> git init --initial-branch=main
error: unknown option `initial-branch=main'
regular code
cd existing_folder
git init --initial-branch=main
git remote add origin [email protected]:path/to/project.git
git add .
git commit -m "Initial commit"
git push -u origin main
to fix the problem you can use this way
Apply Magento2 Patch manually using GIT
The best easy way is to simulate the directory path, so lets assume you will need to fix the comparison page after you upgrade to Magento 2.3.5-p2
Filename: vendor/magento/module-catalog/Helper/Output.php
we need to replace this line
- if (preg_match($pattern, $attributeHtml)) {
with this line
+ if (preg_match($pattern, (string) $attributeHtml)) {
Now create those directories vendor/magento/module-catalog/Helper
Ignore whole Directory and allow only some folders
This wiki will help you add specific directories in the parent directory
Lets say you have two directories
- app
- vendor
in "app" directory there are three folders
app/dir1
app/dir2
app/dir3
app/etc
in "vendor" directory there are three folders as well
vendor/dir1
vendor/dir2
vendor/dir3
you would like to add to GIT repository only these directory
Some GIT command
Get all bracnhes
git fetch --all
To reset specifc branch