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:

  • Tagging a TFS Git repository during a release
  • How do I tell Git it got moves/renames wrong (false positives)
  • Why git svn cannot clone a bare repo?
  • How to install GitFlow for Windows
  • RVM “ERROR: Unable to checkout branch .” single-user
  • How do I determine the source branch of a particular branch?
  • "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?

  • Is it possible to rename an entire “directory of branches”?
  • Git pull from command line prompts for username and password
  • datatables with rails issue
  • Cloned directly from repo…get error when pushing
  • What is the difference between “git add” and “git update-index”
  • Continue working on a Git branch after making a pull request
  • 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.