push-to-github
Steps required to push your Strapi project code to GitHub:
- In the terminal, ensure you are in the folder that hosts the Strapi project you created.
- Run the
git initcommand to initialize git for this folder. - Run the
git add .command to add all modified files to the git index. - Run the
git commit -m "Initial commit"command to create a commit with all the added changes. - Log in to your GitHub account and create a new repository. Give the new repository a name, for instance
my-strapi-project, and remember this name. - Go back to the terminal and push your local repository to GitHub:
a. Run a command similar to the following: git remote add origin git@github.com:yourname/my-strapi-project.git, ensuring you replace yourname by your own GitHub profile name, and my-strapi-project by the actual name you used at step 5.
b. Run the git push --set-upstream origin main command to finally push the commit to your GitHub repository.
Additional information about using git with the command line interface can be found in the official GitHub documentation.
Was this page helpful?