开发者

git commit showing up on origin remote?

开发者 https://www.devze.com 2023-03-01 01:09 出处:网络
I\'m still learning the in\'s and out\'s of git, and the more I learn, the more I like, and the more I realize I don\'t really know what i\'m doing.

I'm still learning the in's and out's of git, and the more I learn, the more I like, and the more I realize I don't really know what i'm doing.

I have several branches, a develop, a master, and two feature branches.

I was working on a feature branch, and I wanted to checkout the develop branch. I got a warning that I had uncommitted changes, so I did a git commit -m'storing changes'

Then I did a checkout on the develop branch.

The problem is that my commit to the feature branch, appears to have been pushed to the origin repository, without my doing.

I开发者_运维知识库 have no idea how it happened. I've gone through the reflog, and through my command history and no where did I explicitly do a push

I'm totally confused, and my boss is going to burn my feet.

EDIT TO ADD:

This is the output of the reflog

4f1641c HEAD@{5}: checkout: moving from feature/X to develop
b67d265 HEAD@{6}: commit (merge): stashing
dd9294d HEAD@{7}: checkout: moving from develop to feature/X

b67d265 is the commit that got pushed. I see the (merge) but I thought if there was a merge, it autocommits locally...

Here is the output of branch -va

  develop                               9b44fac [behind 8] Fixing clicking search annotation causing app crash
* feature/X                       b67d265 stashing
  feature/forecastscroll                8211bfc Updated Forecast Slider to be based on UIScrollView
  master                                4a2a436 Merge branch 'master' of git://X/iOS/X
  servertimedelta                       72e5426 removing comment check
  remotes/X_dev/develop              57f0f03 fixing lockonme not enabled for for new users
  remotes/github/feature/forecastscroll 8211bfc Updated Forecast Slider to be based on UIScrollView
  remotes/origin/HEAD                   -> origin/master
  remotes/origin/develop                fe64f76 Merge branch 'develop' of git://X/iOS/X into develop
  remotes/origin/feature/X        b67d265 stashing
  remotes/origin/master                 4a2a436 Merge branch 'master' of git://X/iOS/X


Use

git branch -va 

to understand where your branches are pointing. You will see local and remote branches, where remotes are tracking the state of the corresponding branches on the remote side.

There is no way that the commit is getting pushed without you pushing anything. Therefore i think information provided by the command above will clear things up. If still confisud - please expand your question with details of commands executed and what the the output of the command above is.


There is also the possibility that if your repository is visible on your local network, someone might have pulled it from you and then pushed the changes up to origin.

0

精彩评论

暂无评论...
验证码 换一张
取 消