How to sync unsynced commits?
Asked Answered
H

2

4

I committed a change in my file and want to sync it. I am using the Windows Github user interface and I am new to this. The sync button does not show up. How can I do this with a shell command?

enter image description here

Heaviness answered 18/7, 2013 at 16:47 Comment(0)
M
1

If you look at the screenshot, near the top it says detached head. Although rather unpleasant sounding, this just means that you're not on a branch but rather having a commit checked out.

Looking at one of your comments, it says rebasing master. Looks to me like a rebase was started, but never finished. If you haven't touched the command line, this sounds like a bug in GitHub for Windows, and I'd report it to GitHub support. It should still be possible to clean this up though.

If you type git status in the command line, you should get something like this (this is on Linux, it may look slightly different on Windows):

[~/dev/cost_model] git status
# Not currently on any branch.
# You are currently rebasing branch 'master' on '174ffcb'.
#   (fix conflicts and then run "git rebase --continue")
#   (use "git rebase --skip" to skip this patch)
#   (use "git rebase --abort" to check out the original branch)
#
# Changes to be committed:
#   (use "git reset HEAD <file>..." to unstage)
#
#   modified:   some/path/to/a/file
#
# Unmerged paths:
#   (use "git reset HEAD <file>..." to unstage)
#   (use "git add <file>..." to mark resolution)
#
#   both modified:      some/other/path/to/a/file
#

The files under "Changes to be committed" are fine, and were rebased just fine. If you have any files under "unmerged paths", though, you should open them and check for merge conflicts (they are sections of the code that begin with "<<<<<<<" or something similar, just open the file and make sure the file ends up looking like you want it to).

Once you've resolved all conflicts, run git rebase --continue. Check the message that appears, there may still be conflicts.

Another option is to run git rebase --abort to stop the rebase if you didn't want it to finish.

Once you're done, you should be back on your branch and be able to sync.

Maraca answered 18/7, 2013 at 17:8 Comment(2)
git rebase --abort did the job. I did touch the command line before. So I think it was a mistake on my side rather than a bug on the Github side. Thanks!Heaviness
Glad to be of help! :)Maraca
F
0

Try: git push origin {branch_name}

Floydflss answered 18/7, 2013 at 16:50 Comment(1)
I tried to figure out my branch and I get > git branch * (no branch, rebasing master) masterHeaviness

© 2022 - 2024 — McMap. All rights reserved.