Edited a file from GitHub, conflict in pushing?

This is my scenario:

Created and uploaded a project on GitHub. Did some commits (ahead of origin/master by n commits). While viewing the repository on GitHub through web browser I found a minor error and can’t control myself from fixing it using GitHub’s very own code editor.

  • How to use grunt changelog?
  • Is there an opposite command to git archive for importing zip files
  • How to check out a version with tig or command line?
  • Git Version Control - Views on Repositories?
  • How can I override the merge-base in a git merge?
  • Jenkins access msbuild file in github probject
  • After coming to my local repository, what do I do now? I neither want to lose the changes from GitHub’s editor nor want to loose changes that I had already commited.

    (I have single branch on that repository (master) and I am only the developer)

  • Git: getting changes from another branch
  • Nice Git architecture for server / client?
  • Can you get a duplicate hash in Git in any way and what are the implications
  • Why do I have multiple branches of a similar name after setting up git-svn
  • Git checkout failing after pulling and changing .gitignore file
  • Download files from git remote repository
  • 2 Solutions collect form web for “Edited a file from GitHub, conflict in pushing?”

    You can do a simple git pull, but I’d recommend doing a git pull --rebase as this will avoid having to have an additional merge commit joining the two development histories, thus keeping your history tidy.

    Here’s a bit of explanation on rebase pulls and how you can enable them by default: http://blog.aplikacja.info/2010/11/git-pull-rebase-by-default/

    You will need to do a git pull, which fetches the changes from Github and merges the two heads.

    If you look at the first graphic here, it explains a similar situation.

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