Getting Started with Git and GitHub


#1

Below is my code when I copied the code from “…or push an existing repository from command line” into my command line.

I received error messages and do not understand what I am doing wrong.

Changes to be committed:emphasized text
(use “git rm --cached …” to unstage)

    new file:   README.txt

Kathy@Kathy-THINK MINGW64 ~/git_practice (master)
$ git remote add origin https://github.com/kataburke/git_practice.git

Kathy@Kathy-THINK MINGW64 ~/git_practice (master)
$ git push -u origin master
error: src refspec master does not match any.
error: failed to push some refs to ‘https://github.com/kataburke/git_practice.gi t’

Kathy@Kathy-THINK MINGW64 ~/git_practice (master)
$ git push -u origin master
error: src refspec master does not match any.
error: failed to push some refs to ‘https://github.com/kataburke/git_practice.gi t’

Kathy@Kathy-THINK MINGW64 ~/git_practice (master)
$ git remote add origin https://github.com/kataburke/git_practice.git
fatal: remote origin already exists.

Kathy@Kathy-THINK MINGW64 ~/git_practice (master)
$ git push -u origin master
error: src refspec master does not match any.
error: failed to push some refs to ‘https://github.com/kataburke/git_practice.gi t’

Kathy@Kathy-THINK MINGW64 ~/git_practice (master)


#2

There’s nothing to push if you have no commits.


#3

I am totally new to this. I was just following step by step instructions. Perhaps instruction needs to be clearer. I have been experimenting and can commit and push. I was confused about error messages as I need this code to move forward with future assignments. Thank you for your time and input.


#4

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.