Skip to main content

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

cd existing_folder
git init
git checkout -b  main
git remote add origin [email protected]:path/to/project.git
git add .
git commit -m "Initial commit"
git push -u origin main

Tags