It is hard to say without any details.
git pull pulls the changes from the remote repository and then merges. It can be configured to redirect instead of merging (either using git pull --rebase , or by setting the true value for branch.<branch_name>.rebase for the branch you are pulling into).
If you started on a branch, any merge type attraction will always leave you on that branch. On the other hand, the rebase command always works using a temporarily detached HEAD (otherwise called a "branch"). If you were left in this state during the attraction of the rebase type, then this is because part of the drag and drop during the collision encountered conflicts and expects you to resolve them and use rebase --continue (or --skip or --abort ).
By default, reflog stores every update that is made for HEAD (there can also be one for each branch). You can view reflog with git reflog show (or git log -g for a more detailed view). This can help you determine how you got into this condition.
If you are in the middle of rebase (you have a .git/rebase-apply directory), then it probably stopped to resolve some conflicts (conflicts). Use git status to check for "unrelated" entries. Any such entries must have conflict markers embedded in the files (provided that they are text files). You must edit them to resolve the conflict (s), and they mark them as merged by running git add on them. Then run git rebase --continue to continue reinstalling. You may encounter a large number of conflicts that should be handled in a similar way (edit, add, continue). If you decide that you no longer need a specific commit, you can skip it with git rebase --skip . You can abort all redirects with git rebase --abort . All of these redirection commands are listed in the error message when rebase terminates due to a conflict. After all pending commits have been applied (or skipped), your original branch will be updated with the last new commit, and your HEAD will be bound to it (if you interrupt, your HEAD will be reconnected without updating the branch).
If your disconnected HEAD was not caused by conflicts that occurred in the middle of the permutation, then your HEAD was disconnected at some point before pulling. You will need to evaluate the current state of the tree to decide what you want to do. You can use git show-branch --current --all or git log --graph --oneline --decorate --all or a graphical tool like gitk to find out how your current (separate) HEAD relates to your other branches . If you decide that you want to keep the contents of your HEAD, you can create a new branch for them using git branch new_branch_name . If you want to overwrite an existing branch, use git branch --force existing_branch_name . Then use git checkout branch_name to reconnect the HEAD of your repository to the branch again.
Chris Johnsen Mar 23 '10 at 9:32 2010-03-23 ββ09:32
source share