tech-pkg archive

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

Re: Help with git/wip



On Wed, Jul 26, 2017 at 06:23:56AM -0400, D'Arcy Cain wrote:
> I seem to be suffering from https://xkcd.com/1597/.  I have already done the
> delete and restart but I still can't seem to make it work.
> 
> $ git commit
> On branch master
> Your branch is ahead of 'origin/master' by 2 commits.
>   (use "git push" to publish your local commits)
> Changes not staged for commit:
>         modified:   Makefile
> 
> no changes added to commit
> git push
> Counting objects: 4, done.
> Delta compression using up to 2 threads.
> Compressing objects: 100% (4/4), done.
> Writing objects: 100% (4/4), 549 bytes | 0 bytes/s, done.
> Total 4 (delta 2), reused 0 (delta 0)
> remote: Merge commit detected: 76a391009afefb5022670512c11b8d91cb9a09e1
> remote: In general, please use 'git pull -r'
> remote: and now make the history straight using 'git rebase -i'
> To wip.pkgsrc.org:/pkgsrc-wip.git
>  ! [remote rejected]       master -> master (pre-receive hook declined)
> error: failed to push some refs to 'darcy%wip.pkgsrc.org@localhost:/pkgsrc-wip.git'
> $ git pull -r
> error: cannot pull with rebase: You have unstaged changes.
> error: please commit or stash them.
> 
> Can someone please give me the magic incantation.
> 
> For the record what I changed was removing pkgin (git rm -r pkgin) and
> edited the Makefile.

Now that I know what you wanted to do, here is how to do it:

vi Makefile
git add Makefile # to tell git that you want to commit this modification with the next commit
git rm -r pkgin # automatically tells git to add this to the next commit
git commit
git pull -r
git push

You were missing the "git add".

You can instead also do:

vi Makefile
git rm -r pkgin # automatically tells git to add this to the next commit
git commit -a # adds all uncommitted changes to the commit
git pull -r
git push

You only need to use git stash if you want to keep uncommitted changes.
 Thomas


Home | Main Index | Thread Index | Old Index