git push origin develop does nothing

git
29,044

Solution 1

Based off your comment the issue is (probably) that you branched repeatedly. (so like bar/develop, foo/bar/develop/ blah/foo/bar/develop, etc).

The reason your rebase is shooting you down is that you can't rebase to a branch that doesn't contain the initial commit you branched from ( fatal: Needed a single revision)

Do the following:

 git status

This will print your current branch. (Lets assume its blah/foo/bar/develop)

From here you have to options.

Option 1) Simpler, might not work if one of the intermediate steps has changed and you want things from it:

 git checkout develop
 git fetch
 git rebase origin/develop
 git merge origin/blah/foo/bar/develop

Option 2) Will work but could be very timeconsuming

 git fetch
 git rebase origin/foo/bar/develop
 git push origin foo/bar/develop
 git checkout foo/bar/develop
 git rebase origin/bar/develop
 git push origin bar/develop
 git checkout bar/develop
 git rebase origin/develop

I would probably try option 1 and only fall back to option 2 if option 1 doesn't work In either case, solve the merge conflicts if any and you're done:

 git commit -a
 git push origin develop

Solution 2

  1. you should do "git add file1 file2 ..." to add your changes
  2. you should do "git commit" to commit your changes to your local git repository
  3. then you can push what you did to the remote repository.
Share:
29,044
Patr01
Author by

Patr01

We consult and build stuff out of Toronto!

Updated on November 15, 2020

Comments

  • Patr01
    Patr01 over 3 years

    I'm new to using git. I tried doing git push origin develop and the terminal says everything is up to date. I tried git diff --stat origin/develop and the terminal displays:

     tpl/view/css/layout.css           |    7 ++++---
     tpl/view/ctrl.time-sheet-item.tpl |   10 +++++-----
     tpl/view/ctrl.time-sheet.tpl      |    7 +++----
     3 files changed, 12 insertions(+), 12 deletions(-)
    

    So to me, it looks like there should still be files to push. I went to my friend's computer and did a git pull origin develop, and it didn't receive the new changes to the three files I mentioned above. How do I push my changes to the develop branch and receive them on another computer?

  • Sled
    Sled over 11 years
    Can you expand your answer? It is rather terse. If you could explain why it doesn't work that'd help rather than just what. "Teach a man to fish..." and all that.