How to push on remote branches?

7

I have a local branch called ResultadoAPI , the remote is located in origin / feature / ResultAPI
I tried pushing in different ways but this remote is still outdated.

daniela.morais@tusk:~/Development/git/oknok-clicktag$ git push origin origin/feature/ResultadoAPI 
Everything up-to-date
daniela.morais@tusk:~/Development/git/oknok-clicktag$ git push origin ResultadoAPI 
Counting objects: 65, done.

The command git push origin ResultadoAPI has created ANOTHER remote and is pushing it. How do I push correctly on the remote?

** UPDATE

daniela.morais@tusk:~/Development/git/oknok-clicktag$ git status
On branch ResultadoAPI
Your branch is ahead of 'origin/feature/ResultadoAPI' by 9 commits.
  (use "git push" to publish your local commits)

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

        modified:   oknok-commons/src/main/java/oknok/auth/AuthFilter.java

no changes added to commit (use "git add" and/or "git commit -a")
daniela.morais@tusk:~/Development/git/oknok-clicktag$ git pull
Already up-to-date.

I have% d,% with%, commit is done with success and try to push but is not possible Home Maybe the problem is git add -A , but even with quotation marks I can not push:

daniela.morais@tusk:~/Development/git/oknok-clicktag$ git push origin "feature/ResultadoAPI"
error: src refspec feature/ResultadoAPI does not match any.
error: failed to push some refs to 'ssh://[email protected]/oknok-clicktag.git'
daniela.morais@tusk:~/Development/git/oknok-clicktag$ git push origin "origin/feature/ResultadoAPI"
Everything up-to-date
daniela.morais@tusk:~/Development/git/oknok-clicktag$ git push origin "feature/ResultadoAPI:feature/ResultadoAPI"
error: src refspec feature/ResultadoAPI does not match any.
error: failed to push some refs to 'ssh://[email protected]/oknok-clicktag.git'
    
asked by anonymous 06.05.2015 / 16:27

2 answers

1

Come on,

first see how your repository is

git status
  • Are you in the right branch?
  • Are you missing commits?
  • Branch is Outdated?
  • None of the above?

If wrong branch

git checkout ResultadoAPI

If there is pending commit ...

commit -m "msg..commit"

Note: you may have to add some files before committing them.

git add --all
git commit -a  ou git commit -m "commit"

if there are new updates

git pull origin  ResultadoAPI

When everything is ok

git push origin ResultadoAPI

If it appears

Everything up-to-date

It's OK, but if you still do not upgrade there, you're probably in the wrong branch, or you did not commit your updates, another possibility is to forget to add anything to the repository.

git add --all 
    
06.05.2015 / 16:44
1

Try the following:

git remote -v

This will list the currently configured remote repositories

Then do the following:

git remote add upstream https://github.com/ORIGINAL_OWNER/ORIGINAL_REPOSITORY.git

Where ORIGINAL_OWNER is your user and ORIGINAL_REPOSITORY the name of your original repository

Make sure everything is set up:

git remote -v

Setting up a remote for a fork - official help

    
27.07.2015 / 18:36