git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Get "Your branch is ahead of 'origin/master'" message when explicitly passing origin url at push command

From
BSBentzy Sagiv <bentzy.sagiv@firemon.com>
Date
Aug 26, 2018, 11:37 UTC
Message-ID
<MWHPR10MB1517982C582BEFB7D9171EFD9B340@MWHPR10MB1517.namprd10.prod.outlook.com>

git version 2.7.4 ______________________________________________________________________________________________________

First try: NOT passing origin url explicitly

ubuntu@ci-bentzy:/var/lib/jenkins$ git remote -v origin https://USER @ bitbucket.org/OWNER/jenkinsconf-repo.git (fetch) origin https://USER @ bitbucket.org/OWNER/jenkinsconf-repo.git (push)

ubuntu@ci-bentzy:/var/lib/jenkins$ sudo vim jobs/bentzytest1/config.xml
ubuntu@ci-bentzy:/var/lib/jenkins$ sudo git add .
ubuntu@ci-bentzy:/var/lib/jenkins$ sudo git commit -m'First try' -a
[master b8549c3] First try
 1 file changed, 2 insertions(+), 2 deletions(-)
 
ubuntu@ci-bentzy:/var/lib/jenkins$ sudo git push
Password for 'https://USER @ bitbucket.org':
Counting objects: 5, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (4/4), done.
Writing objects: 100% (5/5), 399 bytes | 0 bytes/s, done.
Total 5 (delta 3), reused 0 (delta 0)
To https://USER @ bitbucket.org/OWNER/jenkinsconf-repo.git
   d2cc229..b8549c3  master -> master
  
ubuntu@ci-bentzy:/var/lib/jenkins$ git status
On branch master
Your branch is up-to-date with 'origin/master'.
nothing to commit, working directory clean
ubuntu@ci-bentzy:/var/lib/jenkins$
______________________________________________________________________________________________________
Second try: passing origin url explicitily

ubuntu@ci-bentzy:/var/lib/jenkins$ git remote -v origin https://USER @ bitbucket.org/OWNER/jenkinsconf-repo.git (fetch) origin https://USER @ bitbucket.org/OWNER/jenkinsconf-repo.git (push)

ubuntu@ci-bentzy:/var/lib/jenkins$ sudo vim jobs/bentzytest1/config.xml
ubuntu@ci-bentzy:/var/lib/jenkins$ sudo git add .
ubuntu@ci-bentzy:/var/lib/jenkins$ sudo git commit -m'Second try' -a
[master 331ac84] Second try
 1 file changed, 1 insertion(+), 1 deletion(-)
 
ubuntu@ci-bentzy:/var/lib/jenkins$ sudo git push https://bitbucket.org/OWNER/jenkinsconf-repo.git
Username for 'https://bitbucket.org': USER
Password for 'https://USER @ bitbucket.org':
Counting objects: 5, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (4/4), done.
Writing objects: 100% (5/5), 403 bytes | 0 bytes/s, done.
Total 5 (delta 3), reused 0 (delta 0)
To https://bitbucket.org/OWNER/jenkinsconf-repo.git
   7383066..331ac84  master -> master
  
ubuntu@ci-bentzy:/var/lib/jenkins$ git status
On branch master
Your branch is ahead of 'origin/master' by 1 commit.
  (use "git push" to publish your local commits)
nothing to commit, working directory clean
______________________________________________________________________________________________________
      
An additional " sudo git push" (without explicit origin) solves the issue
Bentzy Sagiv
 
   
    
 
    
Next: Bryan Turner
Message 1 of 3 in “Get "Your branch is ahead of 'origin/master'" message when explicitly passing origin url at push command”
  1. Bentzy SagivAug 26, 2018
  2. Bryan TurnerAug 26, 2018
  3. Bentzy SagivAug 27, 2018

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.