creating new repository 1

creating new repository

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

Here is what the above code is Doing:
1. Create a new directory called comp305_cw1
2. Change into that directory
3. Create a new file called README.md
4. Add some text to the file
5. Initialise the directory as a git repository
6. Add the README.md file to the repository
7. Commit the changes to the repository
8. Create a new branch called main
9. Add a remote repository called origin
10. Push the changes to the remote repository

Similar Posts