github for mac doesn't allow to perform partial checkin/commit

11,280

Solution 1

Rather than "syncing" your changes, GitHub for Mac does offer you the ability to push, pull and sync changes. Unfortunately, the UI button is for sync only. However, if you go to the menu bar, under "Repository" you see there are two additional changes: push (command + P) or pull (shift + command + P).

Solution 2

Since I believe sync does both git pull and git push, it's trying to pull and merge changes from the remote repository to your local branch. If you want to successfully sync your changes with uncommitted local changes, you should stash your changes, do sync, and then unstash your changes. Remember, if there are conflicting changes when you unstash, you'll have to figure out the correct way to merge them.

edit: Under Repository, you can do push (Cmd + P) or pull (Shift + Cmd + P).

Share:
11,280
Mutant
Author by

Mutant

Engineer/Developer Python, Django, C#, Angular, raphaeljs, NLP, ML, visualizations and Life long learner. #SOreadytohelp If you think perception is everything and if think more it doesn't really matter

Updated on June 03, 2022

Comments

  • Mutant
    Mutant about 2 years

    I am using GitHub for Mac, and have bunch of changes in my branch. I am have committed some of the changes and kept others as uncommitted as I am expecting some more changes. however, when I try to do sync in order to push those changes to Git repository it complains - 'Uncommitted Changes - Please commit all your changes before syncing.'

    Any idea? does it expects all the changes to be committed all the time when you do sync?

  • Mutant
    Mutant over 12 years
    ok..Is there any manual way i can push a single file from git command line?
  • Lazy Badger
    Lazy Badger over 12 years
    @Mutant - you push always not file, but changeset
  • Waynn Lue
    Waynn Lue over 12 years
    Right, so because of what @Lazy Badger said, you need to commit just that one file, then push that commit.
  • Mutant
    Mutant over 12 years
    @WaynnLue - I tried the same thing. Just committed one file and i see that commit in separate section called 'Unsynced Commits', when try to click on Sync for that commit it throws error that please commit all your changes before syncing. So i believe its talking about the uncommitted changes.
  • Waynn Lue
    Waynn Lue over 12 years
    @Mutant If you want to successfully sync your changes while having uncommitted changes, you should follow the steps in the original answer. You'll have to stash any un-committed changes, do your sync, then unstash them. You'll either have to do this from the git command line (which you'll need to install), or you might be able to do it by switching branches (mac.github.com/help.html implies that switch branches automatically does stash for you). But you should try to do the first one, since it's probably the best way to do it.
  • Luca Molteni
    Luca Molteni over 12 years
    Thank you, it was very helpful
  • Jay Sidri
    Jay Sidri over 10 years
    The UI for that is confusing - esp for users who are new to the mac client. +1 for the keyboard shortcut.
  • Bart
    Bart over 10 years
    I would say that you should only do this (stashing) if pushing (as suggested by @Curley) does not work.
  • Kendra Little
    Kendra Little over 10 years
    Thank you, this was super helpful!
  • sb_269
    sb_269 about 10 years
    Life saviour mate! What was the harm in adding just two more buttons to Github that make so much sense !!! Thanks a ton