paparazzi-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Paparazzi-devel] GIT uploading problem


From: Felix Ruess
Subject: Re: [Paparazzi-devel] GIT uploading problem
Date: Fri, 1 Apr 2011 19:07:22 +0200

Hi Bruzzlee,

I saw you managed to push your changes to your fork.

Just keep in mind that with a git push you update the remote ref
(bruzzlee/master) to your local ref (your local master branch).
So if you make a commit after the push, it is a local commit and you
have to push again to get it into your github repo.
That is why git tells you:
Your branch is ahead of 'bruzzlee/master' by 1 commit.

And what is slow? Local git operations?
You can run 'git gc' manually which will garbage collect old
unreachable objects and optimize the repo. But if you have a recent
git version this should be done automatically when necessary...
If you have a shell extension that shows you your git status, that
might be the actual bottleneck... especially if you have a lot of
untracked files.

Cheers, Felix

On Fri, Apr 1, 2011 at 6:11 PM, Leandro Chelini
<address@hidden> wrote:
> Hi Felix
>
> Your answer helped me alot!
>
> I used this variant:
>
>   git fetch paparazzi
>   git reset --hard paparazzi/master
>   git push bruzzlee --force
>
>
> added my files / changes
> git push bruzzlee
> git commit -m "text"
>
> now it says
> Your branch is ahead of 'bruzzlee/master' by 1 commit.
>
> I think it works now, but really slow. Could it be?
>
> Thanks again Bruzzlee
>
> Am 01.04.11 16:02, schrieb Felix Ruess:
>>
>> Hi Bruzzlee,
>>
>>
>>> Now:
>>> I added the remote:
>>> git remote add bruzzlee address@hidden:Bruzzlee/paparazzi.git
>>>
>>> I added the remote
>>> git remote add paparazzi git://github.com/paparazzi/paparazzi.git
>>
>> What remotes did you already have? You probably have duplicate remotes
>> now (e.g. origin as a duplicate of bruzzlee, depending on where you
>> initially cloned from.
>>
>>
>>> git push bruzzlee master
>>> To address@hidden:Bruzzlee/paparazzi.git
>>>  ! [rejected]        master ->  master (non-fast-forward)
>>> error: failed to push some refs to
>>> 'address@hidden:Bruzzlee/paparazzi.git'
>>> To prevent you from losing history, non-fast-forward updates were
>>> rejected
>>> Merge the remote changes (e.g. 'git pull') before pushing again.  See the
>>> 'Note about fast-forwards' section of 'git push --help' for details.
>>
>> What state was your repo in when you did that? That was before you
>> reset your branch to before the commit where you removed everything?
>>
>>> git pull paparazzi master
>>>  From git://github.com/paparazzi/paparazzi
>>>  * branch            master     ->  FETCH_HEAD
>>> Updating 03ba316..81d95ee
>>> Fast-forward
>>>  TODO                                               |  140 ---
>>>  conf/Makefile.lpc21                                |    2 +-
>>>  conf/Makefile.stm32                                |   30 +-
>>> ....
>>> ....
>>>
>>> git reset --hard HEAD^
>>> HEAD is now at 03ba316 Try to ony copy gyro data when it's fresh
>>> (seams it does something but, I can't see any result)
>>
>> This resets your branch to one commit before, so it basically sets
>> your master to the commit before the merge. Not what you want...
>> You probably want to throw away the commit where you deleted everything...
>>
>> I can't tell you exactly what to do, because I don't know what commits
>> you have locally, what you already did, etc...
>> Have a look at your history and where your current master is with
>> gitk --all
>>
>>> Maybe GIT is not made for that, what I want to do:
>>> - I have a "old" project folder (different version as my fork)
>>> - I want to upload it, so that other interested guys are able to download
>>> it.
>>> - Maybe It will be the best way to upload it via ZIP or else
>>
>> Whatever you like... but it might be easier to checkout your stuff if
>> you have it in a branch in your git repo...
>>
>>> How can I completely reset my fork? (If its possible)
>>> My Idea:
>>> - Reset fork
>>> - Download fork
>>> - change the downloaded fork manually (replace all files locally)
>>> - push the new version
>>
>> Reset to what? The Paparazzi master?
>>
>> If you don't have anything on your fork that you want to keep:
>> * Quick'n dirty version: delete your fork and create a new one.
>> * Or the git way: just reset your master to the same as the Paparazzi
>> master:
>>    git fetch paparazzi
>>    git reset --hard paparazzi/master
>>    git push bruzzlee --force
>> The last command will push your local master to your bruzzlee fork and
>> overwrite your master there, so you will loose the commits on your
>> current own master that are not in the main branch. Normally you
>> REALLY DO NOT want to do this!
>>
>> Otherwise... you have commits you want to keep, it depends on what you
>> have in you local repo.
>> You have two commits in your fork on github, I assume you want to keep
>> the first one and get rid of the second one where you deleted
>> everything. Also assume you don't have any other commits locally you
>> want to keep.
>> You have two options:
>> 1. reset your master to the first commit (completely loosing the
>> second one where you deleted everything)
>> 2. "undo" the changes of the second commit
>> Normally you should NEVER do version 1, since someone could have
>> pulled your commits in already. But in your case I think it is safe to
>> assume that noone already pulled in your commit removing everything,
>> so you can go for version 1.
>>   git fetch bruzzlee
>>   git reset --hard bruzzlee/master^
>>   git push bruzzlee --force
>>
>>
>> Cheers, Felix
>>
>> _______________________________________________
>> Paparazzi-devel mailing list
>> address@hidden
>> http://lists.nongnu.org/mailman/listinfo/paparazzi-devel
>>
>
> _______________________________________________
> Paparazzi-devel mailing list
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/paparazzi-devel
>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]