Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

git push origin develop does nothing

Tags:

git

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?

like image 981
John Avatar asked Nov 15 '12 01:11

John


2 Answers

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
like image 88
Abraham P Avatar answered Oct 01 '22 23:10

Abraham P


  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.
like image 24
chylli Avatar answered Oct 02 '22 00:10

chylli