[Sugar-devel] git problems (reprise)
James Cameron
quozl at laptop.org
Mon Dec 27 23:09:13 EST 2010
On Mon, Dec 27, 2010 at 10:27:26PM -0500, Art Hunkins wrote:
> then:
> git init
This is where you went wrong. You've created an entirely new repository
instead of cloning the existing one.
> git add <the three changed files - as listed below>
> git status
> <everything looks good>
>
> the console output then picks up and tells the rest of the story:
>
> [liveuser at localhost FileMix.activity]$ git commit -a -m"Version 4
> changes: ObjectChooser and Sugar-version ID reworked"
> [master (root-commit) 3b7e345] Version 4 changes: ObjectChooser and
> Sugar-version ID reworked
> 3 files changed, 494 insertions(+), 0 deletions(-)
> create mode 100755 FileMixReadMe.txt
> create mode 100755 activity/activity.info
> create mode 100755 filemix.py
> [liveuser at localhost FileMix.activity]$ git push
> gitorious at git.sugarlabs.org:filemix/mainline.git
> To gitorious at git.sugarlabs.org:filemix/mainline.git
> ! [rejected] master -> master (non-fast-forward)
> error: failed to push some refs to
> 'gitorious at git.sugarlabs.org:filemix/mainline.git'
> To prevent you from losing history, non-fast-forward updates were rejected
> Merge the remote changes before pushing again. See the 'non-fast-forward'
> section of 'git push --help' for details.
As you guess, the push is where the problem happened. The cause
of this error is that you are trying to push from a repository that
doesn't have the same history of change. This is because your new local
repository is totally unrelated to the remote repository. It is
unrelated because it was created with "git init" instead of "git clone".
You might do one of these things:
1. clone into a new directory, copy those changed files into it,
commit, and push again,
2. understand the difference between the history of your local
repository and the remote repository, and adjust it somehow, such as
with a merge before a push.
I recommend (1) above. I don't recommend (2), although it is possible,
it is not necessary.
I'm happy to try to help you through this, and I've cloned the
repository git://git.sugarlabs.org/filemix/mainline.git so that I can be
prepared to answer questions.
Expanding on (1) above:
git clone gitorious at git.sugarlabs.org:filemix/mainline.git filemix.git
cd filemix.git
cp ${THOSE_FILES} .
git add FileMixReadMe.txt activity/activity.info filemix.py
git commit -m 'Version 4 changes: ObjectChooser and Sugar-version ID reworked'
git push
--
James Cameron
http://quozl.linux.org.au/
More information about the Sugar-devel
mailing list