kostmo <
kos...@gmail.com> wrote:
> I would like to submit the suggested modifications to this change:
>
https://review.source.android.com/#change,13370
> Normally, I would switch to my branch, "git add" the modified files,
> "git commit --amend", and finally "repo upload --replace .".
>
> However, my local copy of the Android project has been deleted since I
> originally submitted the change. I have checked out a fresh new copy
> of the Android project now. How do I proceed from here?
>
> What I have tried so far is this:
> 1) Start a new branch: "repo start new_branch_name"
> 2) Execute the "Download" command listed on Gerrit: "repo download
> platform/frameworks/base 13370/2"
> 3) make the changes
> 4) "git add"
> 5) "git commit --amend"
> 6) "repo upload --replace ."
>
> However, this results in:
> "no branches ready for upload"
That is because the Download command checked out a detached HEAD,
which means it disconnected from the branch you started. Your commit
was updated on the detached HEAD and was never associated with
your branch.
You can resolve that:
Forcefully recreate that new branch from your current state:
$ git branch -f new_branch_name HEAD
Now switch to it, so any further updates go to the branch rather
than the detached HEAD:
$ git checkout new_branch_name
At this point, since the branch has a change in it, you should be
able to repo upload:
$ repo upload --replace .