As I understand from answers given elsewhere on StackExchange - the process is suppossed to be simple:
a) git checkout master
b) git fetch origin
c) git pull origin
d) git push myremote # named aixtools
e) git checkout bpo-XXXXX
f) git merge master
g) git push myremote
Until step g) everything works as expected. And when it is a tag from the 'origin' rather than a 'PR' I am trying to keep in sync, the process works fine.
Help, wisdom, guidance, et al is much appreciated:
step g currently
michael@x071:[/data/prj/python/git0/gcc-python3-3.7]git status
On branch bpo-11191
Your branch is ahead of 'aixtools/bpo-11191' by 564 commits.
(use "git push" to publish your local commits)
nothing to commit, working tree clean
michael@x071:[/data/prj/python/git0/gcc-python3-3.7]git push aixtools
Username for 'https://github.com':
Password for 'https://aixtools@github.com':
To https://github.com/aixtools/cpython.git
! [rejected] bpo-11191 -> bpo-11191 (non-fast-forward)
error: failed to push some refs to 'https://github.com/aixtools/cpython.git'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Integrate the remote changes (e.g.
hint: 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
A day further: I am thinking, after reading up more on reset and merge, and some of the examples there - that rather than a pull to my local master, commit of local master, and then merge local branch with local 'master' I should also just 'pull' from 'other remote' as a kindof merge.
In any case - I restored a backup of the local situation (always make a copy when I try some 'new' for me with git) And I hope the following answers the comment/query regarding the status of the 'local'
michael@x071:[/data/prj/python/git0/gcc-python3-3.7]git branch
* bpo-11191
master
michael@x071:[/data/prj/python/git0/gcc-python3-3.7]git status
On branch bpo-11191
Your branch is up-to-date with 'aixtools/bpo-11191'.
nothing to commit, working tree clean
michael@x071:[/data/prj/python/git0/gcc-python3-3.7]git diff aixtools/bpo-11191
michael@x071:[/data/prj/python/git0/gcc-python3-3.7]
Or
michael@x071:[/data/prj/python/git0/gcc-python3-3.7]git log --oneline | head -1
5a3284f (HEAD -> bpo-11191, aixtools/bpo-11191) Fix test_run and related tests Almost fix test_search_cpp
michael@x071:[/data/prj/python/git0/gcc-python3-3.7] aixtools/bpo-11191 | head -1 <
5a3284f (HEAD -> bpo-11191, aixtools/bpo-11191) Fix test_run and related tests Almost fix test_search_cpp
So, maybe the question needs to be rephrased:
- should I merge locally?
- pull from "other remote" aka 'project owners'?
- something else entirely?
Next attempt - using merge (maybe I should have merged from a different branch. "master" was what is now 3.7 (I am guessing) - so maybe I should have merged from cpython/3.7.
So, now I feel "howto"ish again.
Basically, I have a PR that I would like to keep/verify that it is still "in sync" with current developments - and update the PR with the current status. A (desired by me) side-effect is that the PR will be re-evaluated again by the "verification process".
I may be facing a situation that "cpython" does not merge my PR before the next release. Should that happen I would like to use, as much as possible, git "merge" and/or "pull" of my open PR (aka bpo-XXXXX) into a "AIX-release" branch.
The steps I see for that would be:
a) checkout the official release branch
b) create and checkout a new "aix-release" branch
c) merge my (local) branches, one at a time, into the new branch
d) commit (and push) the new "release"
So, to simplify/verify the merge into the new release I would like to know, and "store" the bpo-XXXXX with the most recent "sync" with the master and/or named branches.
I am aware that - when it comes to git - I am a Sunday driver. It may be obvious to you. But I think for many (at least I hope I am not alone :smile:) git is not straightforward in what does what. Very powerful - yes - but I feel overwhelmed by it's power. Thx for your assistance!
(FYI: last attempt, new failure - I am very curious about what specific steps were used to -- checkout, merge, and push - and have it all work? Did you get my bpo, push that, then merge, then commit (local), then push - or use some other workflow. Probably - what I am looking for is the workflow that came ' naturally' to you.
michael@x071:[/data/prj/python/git0/gcc-python3-3.7]git merge cpython/master
...
Merge made by the 'recursive' strategy.
...
michael@x071:[/data/prj/python/git0/gcc-python3-3.7]git status
On branch bpo-11191
Your branch is ahead of 'aixtools/bpo-11191' by 564 commits.
(use "git push" to publish your local commits)
nothing to commit, working tree clean
michael@x071:[/data/prj/python/git0/gcc-python3-3.7]git push aixtools
Username for 'https://github.com':
Password for 'https://aixtools@github.com':
To https://github.com/aixtools/cpython.git
! [rejected] bpo-11191 -> bpo-11191 (non-fast-forward)
error: failed to push some refs to 'https://github.com/aixtools/cpython.git'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Integrate the remote changes (e.g.
hint: 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
michael@x071:[/data/prj/python/git0/gcc-python3-3.7]git pull cpython
remote: Counting objects: 1908, done.
remote: Compressing objects: 100% (4/4), done.
remote: Total 1908 (delta 752), reused 751 (delta 751), pack-reused 1153
Receiving objects: 100% (1908/1908), 1.11 MiB | 2.01 MiB/s, done.
Resolving deltas: 100% (1334/1334), completed with 161 local objects.
From https://github.com/aixtools/cpython
fea0a12..b94d739 3.7 -> cpython/3.7
You asked to pull from the remote 'cpython', but did not specify
a branch. Because this is not the default configured remote
for your current branch, you must specify a branch on the command line.
michael@x071:[/data/prj/python/git0/gcc-python3-3.7]git pull cpython 3.7
From https://github.com/aixtools/cpython
* branch 3.7 -> FETCH_HEAD
Auto-merging README.rst
CONFLICT (content): Merge conflict in README.rst
Auto-merging Python/importlib_external.h
CONFLICT (content): Merge conflict in Python/importlib_external.h
Auto-merging Python/importlib.h
CONFLICT (content): Merge conflict in Python/importlib.h
Auto-merging Python/compile.c
CONFLICT (content): Merge conflict in Python/compile.c
Auto-merging Objects/frameobject.c
CONFLICT (content): Merge conflict in Objects/frameobject.c
Auto-merging Lib/test/test_sys_settrace.py
CONFLICT (content): Merge conflict in Lib/test/test_sys_settrace.py
Auto-merging Lib/test/test_random.py
CONFLICT (content): Merge conflict in Lib/test/test_random.py
Auto-merging Lib/pydoc_data/topics.py
CONFLICT (content): Merge conflict in Lib/pydoc_data/topics.py
Auto-merging Lib/importlib/_bootstrap_external.py
CONFLICT (content): Merge conflict in Lib/importlib/_bootstrap_external.py
Auto-merging Lib/enum.py
Auto-merging Include/patchlevel.h
CONFLICT (content): Merge conflict in Include/patchlevel.h
Auto-merging Doc/whatsnew/3.7.rst
CONFLICT (content): Merge conflict in Doc/whatsnew/3.7.rst
Auto-merging Doc/tools/templates/indexsidebar.html
CONFLICT (content): Merge conflict in Doc/tools/templates/indexsidebar.html
Auto-merging Doc/tools/extensions/pyspecific.py
Auto-merging Doc/library/re.rst
CONFLICT (content): Merge conflict in Doc/library/re.rst
Auto-merging Doc/library/dis.rst
CONFLICT (content): Merge conflict in Doc/library/dis.rst
Auto-merging Doc/library/configparser.rst
CONFLICT (content): Merge conflict in Doc/library/configparser.rst
Auto-merging .travis.yml
CONFLICT (content): Merge conflict in .travis.yml
Auto-merging .github/appveyor.yml
CONFLICT (content): Merge conflict in .github/appveyor.yml
Automatic merge failed; fix conflicts and then commit the result.
bpo-11191
branch? I forked your repository, and rangit checkout bpo-11191; git merge master; git push
and it worked fine, as you can see on github.com/skitt/cpython/tree/bpo-11191.git reset --hard
.