I am currently learning how to create a repository using Git Bash and push it to GitHub.
You will see below my steps on Git Bash.
Before these steps I had set up my user name and email address on Git.
Where I get stuck is that after copying the command from GitHub ('..
or push an existing repository from the command line git remote add origin https://github.com/userName/git_test.git git branch -M main git push -u origin main ')
After I copied the command line from GitHub, nothing happens ...
The cursor keep clicking for ages , as no $ sign appears, after like 20 mn did Ctrl + C so i can write a command to check if it works (hence my second steps below)
The README.txt size is super small so I don't think that is the problem.
Is anyone has suggestion on why it doesn't work ?
Also it is my second try, I have created another repository git_practice which I would like to cancel but my computer won't let me as it says it is open on another program.
I HAVE REPLACED MY NAME WITH USERNAME
// FIRST STEPS : My steps on Git Bash :
username@LAPTOP-KCM8PO5E MINGW64 ~
$ pwd
/c/Users/username
username@LAPTOP-KCM8PO5E MINGW64 ~
$ mkdir git_test
username@LAPTOP-KCM8PO5E MINGW64 ~
$ cd git_test
username@LAPTOP-KCM8PO5E MINGW64 ~/git_test
$ git init
Initialized empty Git repository in C:/Users/username/git_test/.git/
username@LAPTOP-KCM8PO5E MINGW64 ~/git_test (master)
$ git add README.txt
username@LAPTOP-KCM8PO5E MINGW64 ~/git_test (master)
$ git commit -m "Add README.txt"
[master (root-commit) d3be350] Add README.txt
1 file changed, 1 insertion(+)
create mode 100644 README.txt
username@LAPTOP-KCM8PO5E MINGW64 ~/git_test (master)
$ git log
commit d3be3501277fae8bf66dee882df3285ade5f7efa (HEAD -> master)
Author: User Name<username@gmail.com>
Date: Thu Jun 17 19:22:22 2021 +0100
Add README.txt
username@LAPTOP-KCM8PO5E MINGW64 ~/git_test (master)
$ git remote add origin https://github.com/userName/git_test.git
git push -u origin main
username@LAPTOP-KCM8PO5E MINGW64 ~/git_test (master)
$ git branch -M main
username@LAPTOP-KCM8PO5E MINGW64 ~/git_test (main)
$ git push -u origin main
// SECOND STEPS: Nothing happened so after I typed Ctrl + C, the following showed:
username@LAPTOP-KCM8PO5E MINGW64 ~/git_test (main)
$ git push repo_url
fatal: 'repo_url' does not appear to be a git repository
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
username@LAPTOP-KCM8PO5E MINGW64 ~/git_test (main)
$