emergency Git assistance needed; my bad

19 views
Skip to first unread message

Bob Carpenter

unread,
Mar 12, 2015, 10:16:20 AM3/12/15
to stan...@googlegroups.com
Git is soooo confusing. I seem to be in an infinite regress,
then when I tried to fix it by following their hints, I think
I mistakenly merged straight into develop. Argh!

Here's what happened:

I created a branch issue-1363-__float128.

I then updated the var ctor to solve the __float128 issue.

But I could't push it back to origin. Here's what happened:

~/stan(feature/issue-1363-__float128)$ git status
# On branch feature/issue-1363-__float128
nothing to commit, working directory clean

~/stan(feature/issue-1363-__float128)$ git pull
Already up-to-date.

~/stan(feature/issue-1363-__float128)$ git diff develop
diff --git a/src/stan/math/rev/core/var.hpp b/src/stan/math/rev/core/var.hpp
index 5ed6b85..be7b43f 100644
--- a/src/stan/math/rev/core/var.hpp
+++ b/src/stan/math/rev/core/var.hpp
@@ -1,12 +1,12 @@
#ifndef STAN__MATH__REV__CORE__VAR_HPP
#define STAN__MATH__REV__CORE__VAR_HPP

+#include <boost/math/tools/config.hpp>
#include <ostream>
#include <stan/math/rev/core/vari.hpp>
#include <stan/math/rev/core/grad.hpp>
#include <stan/math/rev/core/chainable.hpp>
#include <stan/math/rev/core/chainable_alloc.hpp>
-#include <boost/utility/enable_if.hpp>
....


~/stan(feature/issue-1363-__float128)$ git push
fatal: The upstream branch of your current branch does not match
the name of your current branch. To push to the upstream branch
on the remote, use

git push origin HEAD:develop

To push to the branch of the same name on the remote, use

git push origin feature/issue-1363-__float128

~/stan(feature/issue-1363-__float128)$ git push origin feature/issue-1363-__float128
To https://github.com/stan-dev/stan.git
! [rejected] feature/issue-1363-__float128 -> feature/issue-1363-__float128 (non-fast-forward)
error: failed to push some refs to 'https://github.com/stan-dev/stan.git'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Merge the remote changes (e.g. 'git pull')
hint: before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.


Then I'm pretty sure I totally messed things up by pushing directly
into develop by trying to read their hint to solve my problem:

~/stan(feature/issue-1363-__float128)$ git push origin HEAD:develop
Counting objects: 20, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (9/9), done.
Writing objects: 100% (9/9), 1.09 KiB, done.
Total 9 (delta 7), reused 0 (delta 0)
To https://github.com/stan-dev/stan.git
6bdee3f..3a6904a HEAD -> develop
~/stan(feature/issue-1363-__float128)$ git status
# On branch feature/issue-1363-__float128
nothing to commit, working directory clean
~/stan(feature/issue-1363-__float128)$ git pull origin develop
From https://github.com/stan-dev/stan
* branch develop -> FETCH_HEAD
Already up-to-date.
~/stan(feature/issue-1363-__float128)$ git push
fatal: The upstream branch of your current branch does not match
the name of your current branch. To push to the upstream branch
on the remote, use

git push origin HEAD:develop

To push to the branch of the same name on the remote, use

git push origin feature/issue-1363-__float128

~/stan(feature/issue-1363-__float128)$


Could someone help me untangle this mess?

Sorry I keep messing Git up.

- Bob

Daniel Lee

unread,
Mar 12, 2015, 10:19:34 AM3/12/15
to stan...@googlegroups.com
Ok. I think what you want to do is:

git push origin feature/issue-1363-__float128

I'll remove your change from develop (you applied the patch directly to develop).

Did you, by any chance, update OS X? Maybe they snuck a new git version in? I noticed some change in git behavior with their last roll out.


Daniel



- Bob

--
You received this message because you are subscribed to the Google Groups "stan development mailing list" group.
To unsubscribe from this group and stop receiving emails from it, send an email to stan-dev+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Bob Carpenter

unread,
Mar 12, 2015, 10:30:22 AM3/12/15
to stan...@googlegroups.com
Did that, but it doesn't do anything. You can see the response from
git when I tried that originally --- it's one of the commands below.
It's what I always do, but it didn't work this time. Instead, when
I tried to push the branch, it told me to pull, and when I tried to pull,
it told me to push. A Catch-22 from Git!

I realized I applied the patch directly to develop, which is
why I was asking for emergency assistance! I don't trust myself
to whack history.

No, I haven't updated OS X yet.

- Bob
Reply all
Reply to author
Forward
0 new messages