Not see remote changes after 'git pull –rebase'

I am trying to do a ‘git pull –rebase’, but I don’t see any remote changes.
When I do a ‘git status’ I see ‘ Your branch is ahead of ‘origin/master’ by 12 commits.’

But I am current on my ‘dev’ branch, not master.

  • Are there any good, cross platform, Mac, Win32, *nix, Git GUI clients?
  • git is not adding project files other than .gitignore
  • Unable to Git Pull to update my Git local repo
  • How can I find the url after i use 'git clone' to clone a repository
  • How to git diff multiple sibling git folders
  • git conflict keep original upstream
  • $ git branch
    * dev

    And my ‘dev’ branch should track ‘remotes/origin/dev’.

    All I want is I am working on ‘dev’ and I want to get remote changes on remote dev.

    But I did ‘git pull –rebase’ which some how pull remote ‘master’ changes to my ‘dev’ branch.

    Can you pleases tell me how can I recover from my situation?

    1. remove the changes I pull in from remote ‘master’ branch mistakenly (after i did ‘git pull –rebase’)

    2. pull in the changes on remote ‘dev’ branch on to my ‘dev’ branch.

    Thank you.

  • Why do I get merge conflicts when bumping the version?
  • How to find out what causes file permissions to change when checking out files with git?
  • git-svn rebase and dcommit problem
  • Fatal: not a git repository - after BSoD
  • How to set a default user per repo in Git Extensions?
  • finding the name of the git repository
  • 2 Solutions collect form web for “Not see remote changes after 'git pull –rebase'”

    It sounds as if your dev branch was originally based on origin/master instead of origin/dev, or somehow dev has been changed to track origin/master anyway. You can check this with:

    git config

    If that says refs/heads/master instead of refs/heads/dev you can change the upstream branch for your dev branch with:

    git checkout dev
    git branch --set-upstream dev origin/dev

    Then, to fix your branch, I would:

    1. Make sure that you’re on the dev branch with git checkout dev
    2. Make sure that git status is clean
    3. Create a branch to save where you were (for safety): git branch dev-wrongly-rebased
    4. Use git reflog to find the commit before you rebased onto origin/master
    5. Reset dev to that point git reset --hard COMMIT-BEFORE-BAD-REBASE
    6. Finally, do git rebase origin/dev

    My preference when rebasing is always to do it in two steps, e.g.:

    git fetch origin
    git rebase origin/dev

    … since I think that’s less error-prone than git pull --rebase. I hope that’s of some use.

    You can move the commits on top of the correct remote branch with

    git rebase --preserve-merges --onto origin/dev start end

    for a range of commits specified by start and end to be moved onto dev.

    Then, set up tracking properly. If you want, you can edit the .git/config file and compare how traking is set up for each branch all at once and ensure consistent behavior.

    From now on, of you are getting a new remote branch

    git checkout -t origin/branch_name

    Or if you are pushing a new branch to the remote

    git push -u origin branch_name

    These will set up traking as you want.

    Hope this helps.

    Git Baby is a git and github fan, let's start git clone.