Main / Gittrouble
TroubleshootingThis is a retarded gitk error Error in startup script: unknown color name "lime" (processing "-fore" option) invoked from within "$ctext tag conf m2 -fore [lindex $mergecolors 2]" (procedure "makewindow" line 347) invoked from within "makewindow" (file "/usr/bin/gitk" line 12434) Fix by changing all the occurrences of lime in /usr/bin/gitk to another color. Delete the ~/.gitconfig file. If you can't rebase because you have untracked files and this is preventing getting an update from the server, do a clean then rebase. Note that this will destroy any modifications and un-added files. Note that the git gui shows you a tree called master, but this is not apparently the server repo. It appears to be your local workspace, and not even the imaginary repo because a git fetch doesn't help. You have to click on "Tracking Branch" as opposed to "Local Branch" and find the origin/master. Auth error on git clone: What's with this mysterious "modified content"?When a git status shows something like modified: support/buildroot (modified content) you can go into the folder and do a git status to find out what's going on with the files. I guess this is a submodule, so that's why it's not helping you out the right way. What if git won't let me push?This is a moronic error: ... Control Freak ... remote: Commit XXXX rejected: bad committer metadata. remote: "usernameX" does not match your credentials. You are logged in as: "usernameY". No idea why this happens, but the fix is to amend your commit and give it the right author tag at the top. Use git commit --amend --author="John Doe <john@doe.org>" Another push error, "failed to push"To https://<user>@bitbucket.<host>.com/scm/pa/aurix.git ! [rejected] develop -> develop (non-fast-forward) ! [rejected] feature-attack-ts-idpa49 -> feature-attack-ts-idpa49 (non-fast-forward) error: failed to push some refs to 'https://<user>@bitbucket.<host>.com/scm/pa/aurix.git' hint: Updates were rejected because a pushed branch tip is behind its remote hint: counterpart. Check out this branch and integrate the remote changes hint: (e.g. 'git pull ...') before pushing again. hint: See the 'Note about fast-forwards' in 'git push --help' for details. It turns out that this error is sometimes bogus - if you check the repo it will actually have received the push. This problem may be unique to the server (such as Bitbucket). It may also be that this is true, but when you go to do a git pull get this crap: 'Already up-to-date." when it's clearly not. In that case, you may have no choice but to force the push with git push -f. What is 'detached HEAD'?This occurs when your HEAD (that is, the current view or snapshot of the working folder) is pointing to a commit that is off of the base branch. For example, this will occur when you checkout a specific commit or a remote branch (e.g. git checkout origin/branchname). Documenting Git's LiesGit reports this by default, even if it hasn't synced up for a long time so it has no idea what the status of remote is: Switched to branch 'develop' Your branch is up-to-date with 'origin/develop'. Assume you need to do a pull. Here's another one: Working tree has modifications. Cannot add. This is BS when you do a status and you are up to date. Try doing a nothing commit git commit with no other args. Foxtrot mergeWhat if you get this nonsense error when it seems everything should be working? remote: Commit rejected. Foxtrot merges not allowed on "feature/gwu/IDPA-87-multicore". remote: remote: Commit 5019883fb70c06fb contains a foxtrot merge. remote: A rebase will repair the problem: remote: remote: git rebase remote: remote: Alternatively, redo the merge in the opposite direction. The suggestion is BS, as a rebase just rehashes stuff you've already done probably and creates extra commits that aren't really necessary. Instead, you probably need to create a new remote branch because you might be working in a branch tracking an existing remote branch and it's having trouble accepting the commit to that branch. You can simply create a new branch with git checkout -b <newbranch> and then create a new remote branch as you push to it with git push -u <remotename> <newbranch>. Behind the tipWhat if you rebase a synced local branch and then want to push the changes up to the remote branch? Sometimes after doing the rebase git will not let you push, complaining that there are new commits on the remote branch and that you are behind even when no changes have been made to the remote branch. What? It seems you have to use a -f to force the push in this case: https://stackoverflow.com/questions/32339513/cant-push-local-git-branch-upstream |