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.

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)

  • Are there any advantages to forking private repo on GitHub?
  • Clone a local repository into github
  • What to do with unpushed git commits after mvn release:perform
  • Move branches without pushing them to the git repository?
  • GitHub API to Create a File
  • How to import and run project, in Android Studio 1.1, from Github?
  • How can I filter all GitHub pull requests for a specific target branch
  • GitHub Deployment method on BitBucket
  • 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.