Attn: Hugh I made a lot of changed to my local dev branch today for tomorrow's removal of macroSpec/@type allowing <catchwords>, <secFol>, and <signatures> outside of <msDesc> data.*.xml There were problems that will probably break the build (more about those later -- probably as soon as this is dealt with :-), so I decided I should have used a different branch. So I issued: $ git reset --keep HEAD~3 $ git checkout -t -b sydb-deprecationEnd_2018-10-01 $ git cherry-pick ..HEAD@{2} It looks like it *mostly* worked: $ git status -uno | Your branch is ahead of 'dev' by 3 commits. | (use "git push" to publish your local commits) | nothing to commit (use -u to show untracked files) But there are 2 problems: 1) A typo. That "HEAD~3" was supposed to be a "HEAD~5" 2) The 'dev' in that status output makes me worry that if I do a `git push`, these changes would get pushed to dev, not the new sydb-deprecationEnd_2018-10-01 branch. I was smart enough to make a backup of my entire repository before doing this, so I can go back and fix my 3/5 mistake easily. But I thought the point of the -t switch was to set up tracking so that my local sydb-deprecationEnd_2018-10-01 tracks a similarly named branch on the remote (GitHub). Apparently not. What do I do to make that work?
You shouldn't need to restore your repo. Just switch back to dev, get rid
of your branch, and then git checkout -b sydb-deprecationEnd_2018-10-01
HEAD~5 (make sure HEAD~5 is what you want—if dev isn't at the proper HEAD,
you'll get something else). You can't set up a tracking branch unless there
is something to track (i.e. a branch on the remote named
sydb-deprecationEnd_2018-10-01).
When you git push -u it for the first time, a remote branch will be created.
Just FYI, I wouldn't use git reset that way, because you're running the
risk of getting confused about where you're at in your history. A git pull
will fix it if the remote's HEAD is at or later than your original HEAD, of
course, and you won't be able to push until you're in sync with the remote,
but still... I think it's better to use git checkout, either creating a new
branch right away, using -b <name> or putting it into a "detached HEAD"
state, which sounds terrifying, but basically just means you're working on
an anonymous branch, where nothing you do matters unless you turn it into a
named branch (with git checkout -b <name>). If you mess it up and want to
just throw it away, you switch back to dev, and you're done.
Hope that helps,
Hugh
On Sun, Sep 30, 2018 at 11:27 PM Syd Bauman
Attn: Hugh
I made a lot of changed to my local dev branch today for tomorrow's removal of macroSpec/@type allowing <catchwords>, <secFol>, and <signatures> outside of <msDesc> data.*.xml
There were problems that will probably break the build (more about those later -- probably as soon as this is dealt with :-), so I decided I should have used a different branch. So I issued: $ git reset --keep HEAD~3 $ git checkout -t -b sydb-deprecationEnd_2018-10-01 $ git cherry-pick ..HEAD@{2} It looks like it *mostly* worked: $ git status -uno | Your branch is ahead of 'dev' by 3 commits. | (use "git push" to publish your local commits) | nothing to commit (use -u to show untracked files) But there are 2 problems: 1) A typo. That "HEAD~3" was supposed to be a "HEAD~5" 2) The 'dev' in that status output makes me worry that if I do a `git push`, these changes would get pushed to dev, not the new sydb-deprecationEnd_2018-10-01 branch.
I was smart enough to make a backup of my entire repository before doing this, so I can go back and fix my 3/5 mistake easily. But I thought the point of the -t switch was to set up tracking so that my local sydb-deprecationEnd_2018-10-01 tracks a similarly named branch on the remote (GitHub). Apparently not. What do I do to make that work? _______________________________________________ Tei-council mailing list Tei-council@lists.tei-c.org http://lists.lists.tei-c.org/mailman/listinfo/tei-council
participants (2)
-
Hugh Cayless
-
Syd Bauman