push an existing repository from the command line on github 1

push an existing repository from the command line on github

git remote add origin https://github.com/israa790/Athentification_Flutter-Login-Register-.git
git branch -M main
git push -u origin main

Here is what the above code is Doing:
1. git init
– Initializes a new Git repository.
2. git add .
– Adds all files to the staging area.
3. git commit -m “Initial commit”
– Commits all files to the repository with a message.
4. git remote add origin https://github.com/israa790/Athentification_Flutter-Login-Register-.git
– Adds a remote repository to the local repository.
5. git branch -M main
– Creates a new branch called main.
6. git push -u origin main
– Pushes the local repository to the remote repository.

Similar Posts