problem with github
Rémy Mouëza
remy.moueza at gmail.com
Sat Nov 22 12:29:18 UTC 2025
On Saturday, 22 November 2025 at 06:12:29 UTC, Walter Bright
wrote:
> Can anyone explain what I am doing wrong? It says my master is
> the same as the remote master, but I cannot push anything.
> Googling the error message suggests I do a `git pull origin
> master` which replies with `Your branch is up-to-date with
> 'origin master'.
>
> ```
> mercury~/forks/dmd defaultInitialize2> git checkout master
> Switched to branch 'master'
> Your branch is up-to-date with 'origin/master'.
> mercury~/forks/dmd master> git pull origin master
> From github.com:WalterBright/dmd
> * branch master -> FETCH_HEAD
> Already up-to-date.
> mercury~/forks/dmd master> git checkout test
> Switched to branch 'test'
> mercury~/forks/dmd test> git rebase master
> Current branch test is up to date.
> mercury~/forks/dmd test> git diff master
> diff --git a/compiler/src/dmd/parse.d b/compiler/src/dmd/parse.d
> index 6b1ca8e..20f792c 100644
> --- a/compiler/src/dmd/parse.d
> +++ b/compiler/src/dmd/parse.d
> @@ -1,4 +1,4 @@
> -/**
> + /**
> * Takes a token stream from the lexer, and parses it into an
> abstract syntax tree.
> *
> * Specification: $(LINK2 https://dlang.org/spec/grammar.html,
> D Grammar)
> mercury~/forks/dmd test> git push origin test
> To git at github.com:WalterBright/dmd.git
> ! [rejected] test -> test (non-fast-forward)
> error: failed to push some refs to
> 'git at github.com:WalterBright/dmd.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.
> mercury~/forks/dmd test>
> ```
Having given more thoughts to it, here are some ideas to try.
You may have to ensure pour local branch really tracks the remote
one.
Check it with `git branch -vv`:
> git branch -vv
* demo 462f969 [origin/demo] plop
master 462f969 [origin/master] plop
test 6d046ba [origin/test] test-2
If your test branch is only local or does not track origin/test,
set its remote tracking branch with:
git branch -u origin/test test
Since the remote branch is behind master you need to push force.
The `--force-with-lease` option will abort the push if someone
else pushed changes since your last pull.
git push --force-with-lease
More information about the Digitalmars-d
mailing list