I have a directory say cplusplus_learn and my username is apex_user (say) in git. Inside cplusplus_learn, there are some files and directories which I am practising C++ language. I want to make a repository of same name as cplusplus_learn and push every thing in GITHUB website. Can someone please explain me the complete steps for doing that. I went through various links but totally confused. Mostly says that there is already repo is made.
convert-existing-non-empty-directory-into-a-git-working-directory
github-error-repository-not-found-fatal
Note: All things I want to do from terminal.
$ cd cplusplus_learn
$ git init .
$ git commit -m 'My first commit'
$ git remote add origin https://github.com/apex-user.git
fatal: remote origin already exists.
$ git push -u origin master
fatal: repository 'https://github.com/apex-user/' not found
Given above is what I tried. I know there is something wrong but I can't figure that out.
First you need to login in to your github account and create a repository with the name cplusplus_learn
All things I want to do from terminal. Just as you have already described. From your description, it seems that you have a wrong remote url already set so you need to update or reset it as shown below
$ cd cplusplus_learn
$ git init
$ git commit -m 'My first commit'
$ git remote set-url origin https://github.com/apex-user/cplusplus_learn.git
$ git push -u origin master
Hopefully this should work. Thanks :)
cplusplus_learn
.git init
.git remote add origin https://github.com/apex-user/RepoName.git
git add -A
git commit -m "Message you would like to put"
git push origin master
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With