[Top][All Lists]

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

Re: [Paparazzi-devel] GIT uploading problem

From: Gareth Roberts
Subject: Re: [Paparazzi-devel] GIT uploading problem
Date: Fri, 01 Apr 2011 21:54:39 +0100
User-agent: Opera Mail/11.01 (MacIntel)

Hi Leandro,

Glad you got it all sorted.
I found this really helpful for learning git (the manual confused me a bit!)

(P.S Git is one of those things which once you understand, you can't understand how you did without!)

On Fri, 01 Apr 2011 17:11:24 +0100, 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,

I added the remote:
git remote add bruzzlee address@hidden:Bruzzlee/paparazzi.git

I added the remote
git remote add 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://
  * branch            master     ->  FETCH_HEAD
Updating 03ba316..81d95ee
  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
- 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

Paparazzi-devel mailing list

reply via email to

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