create a new repository on the command line 1

create a new repository on the command line

echo "# REPOSITORYNAME" >> README.md
git init
git add README.md
git commit -m "first commit"
git branch -M main
git remote add origin https://github.com/USERNAME/REPOSITORYNAME.git
git push -u origin main

Here is what the above code is Doing:
1. Create a new directory for your project
2. Change into that directory
3. Create a README.md file
4. Initialize a git repository
5. Add the README.md file to the repository
6. Commit the README.md file to the repository
7. Create a new branch called main
8. Add the remote repository
9. Push the changes to the remote repository

Similar Posts