How to push remote branches?

Asked

Viewed 9,322 times

8

I have a local branch called ResultadoAPI, the remote is located in origin/Feature/Resultadoapi
I tried to push in several ways but this remote continues 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 created ANOTHER remote and is pushing it. How do I push properly 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.

Dou git add -A,git commit -m "Nome do commit", the commit is done with success and try to push but is not possible
Maybe the problem is /, but even with quotes I can’t 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'
  • Put git status, you pull ? if you’re using github in public RP, post the link

  • Yes, it has files to commit and is updated when I pull.

  • then, try & #Xa;git add --all , git commit -a

  • Daniela. You can try git push -u origin ResultadoAPI:feature/ResultadoAPI? If it works out, let me know.

  • Assuming you still have the branch and the hehehe project, I haven’t seen the date.

2 answers

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 is your original repository name

Confirm that everything is set up:

git remote -v

How to set up a remote for a Fork - official help

1

Come on,

first see how your repository is

git status
  • You’re in the right branch ?
  • Has commit missing ?
  • Branch is Outdated ?
  • None of the above ?

Case branch wrong

git checkout ResultadoAPI

If there is a pending commit...

commit -m "msg..commit"

Note: You may have to add some file before committing..

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

if new updates exist

git pull origin  ResultadoAPI

When all is well

git push origin ResultadoAPI

If it turns up

Everything up-to-date

It’s all OK, but if you still don’t update there, you’re probably on a wrong branch, or didn’t commit to your updates, another possibility is to forget to add something to the repository.

git add --all 
  • As in the previous comments, this is not the problem. Maybe it’s because of "/"

  • And git push origin ResultadoAPI is the location of "origin/Resultadoapi" and not "origin/Feature/Resultadoapi"

  • Look I may be wrong, but there’s something strange, modified: oknok-Commons/src/main/java/oknok/auth/Authfilter.java ?

  • git add --all is not adding it ?

  • Isvaldo then commented that I added the files to the commit. The problem isn’t closing the commit or updating the branch, but sending these commits to remote (push).

  • I don’t know if you’ve solved it yet, it’s a little weird, creates a new branch and tries to send, git checkout -b New

  • I couldn’t fix it, I had to create another branch anyway =(

Show 2 more comments

Browser other questions tagged

You are not signed in. Login or sign up in order to post.