existing repository 1

existing repository

git remote add origin https://github.com/Polsa96/githubBasicAlgorithms.git
git branch -M main
git push -u origin main

Here is what the above code is Doing:
1. git init – Initializes a git repository in the current directory
2. git add . – Adds all files in the current directory to the staging area
3. git commit -m “Initial commit” – Commits the files in the staging area to the repository
4. git remote add origin https://github.com/Polsa96/githubBasicAlgorithms.git – Adds the remote repository to the local repository
5. git branch -M main – Sets the main branch as the default branch
6. git push -u origin main – Pushes the local repository to the remote repository

Similar Posts