Can't push back to Github

I’m new to github, and keep running into basic errors. Most tutorials seem to be missing something here or there, or more probably it’s me who’s missing something… 🙂

My workflow:

  • Follow renames when performing git subtree split
  • External git difftool is not working on windows
  • Can't get Multiple SSH keys to work for multiple github accounts
  • ansible: git module is hanging
  • Is it possible to create branch that is tracking non-existing remote
  • best way to handle many forks (and “sub-forks”) with Github?
  • "git init"
    "git clone ... " (github url)
    "git add ." (adds the entire directory. 

    I don’t understand why I would need
    to add something that I just cloned…
    Isn’t it obvious that these are the files I want to work with?)

    "git commit -m" this works.
    "git push" Now here the whole thing comes crashing down.

    I would expect that when you clone something from github, the “push” command would push your changes right back.

    But that does not seem to be the case. Git has no idea where my files came from? If I type "git push origin master” I get the error:

    fatal: No configured push destination.

    How do I create the push destination in such a way that it is exactly the same as where my files were cloned from?

  • Pushing git repo files to server
  • What is the method in NGit to see if remote repo changed?
  • Can Git software (e.g. Gitbox, Github, SourceTree) use a remote repo instead of local?
  • Specify private SSH-key to use when executing shell command with or without Ruby?
  • Git (Windows) - failure cloning from a separate-git-dir repository
  • Determining how cvs2git converted CVS trees
  • 3 Solutions collect form web for “Can't push back to Github”

    It looks like you’re initializing a new repo and then doing some cloning, which can be confusing…

    1. moving to fresh folder so your previous work doesn’t create confusion
    2. clone from the github repo you want to work from
    3. cd into that repo and git status to make sure everything is in order

    You should only need to add, commit, and push after you’ve made changes. So try the rest of that workflow after you’re sure you’re in the repo you intended to clone. (instead of a new one you just created)

    Check out Learn Git Branching, it’s a great tutorial that helped me and a bunch of my colleagues.

    either run

    git init


    git clone ...

    not both!

    commit & push generally works better after any modification.

    You can also use git diff to find the difference between working directory & last commit.

    GitHub also provide tools for ease (in case u often get confused with cmd)

    Git Baby is a git and github fan, let's start git clone.