I am working with a team on
git and my local untracked
production branch is missing lines of code from a team member.
master branch is
tracked on the
remote/origin/master and it shows all the code.
production branch was
remote/origin/production with this command
git checkout production
After finishing the
development branch I did:
git checkout production git merge development
I deploy to server and then
git checkout master git merge development git merge production git push origin master
Later I find out that
production branch and server are missing some lines of code (while
master is ok)
I thought this could be caused by the fact that the remote branch was not
git checkout --track production
Then I found that
git diff master..production does not show differences, but analyzing the production branch I can find this
commit relative to the merge of the
git show b17832a commit b17832ae656f1bd43ebf837934f16b7d1f6efa33 Merge: a9bd850 0873d56 Merge branch 'development'
and here I can find the removed line of code
git diff a9bd850..0873d56 file.rb diff --git a/file.rb index e0d1d1b..2343d92 100644 --- a/file.rb +++ b/file.rb @@ -49,12 +49,6 @@ angular.module('sp').directive 'spPlayer', [ some text and below I can find - my missing line of code - is showing here
how can I fix the production branch and push the change? My commit on master have already been push to the remote.ruby-on-railsgit
Later I find out that production branch and server are missing some lines of code (while master is ok)
master then push to remote
$ git checkout production $ git merge master $ git push origin production
remote master (origin/master)
$ git checkout master $ git push origin master
N.B. the issue is solved discussing in OP's comment section actually.