How do I synchronise two remote Git repositories?

Git branches do not have “heads” in the Mercurial sense. There is only one thing called HEAD, and it’s effectively a symlink to the commit you currently have checked out. In the case of hosted repositories like GitHub, there is no commit checked out—there’s just the repository history itself. (Called a “bare” repo.) The reason … Read more

How do I swap the order of two parents of a Git commit?

Actualy, there’s a really cool command I learned recently that will do exactly what you want: git commit-tree -p HEAD^2 -p HEAD^1 -m “Commit message” “HEAD^{tree}” This will create a new commit based on what is currently HEAD, but pretend that it’s parents were HEAD^2,HEAD^1 (note this is the reversed order). git-commit-tree prints the new … Read more

git says “fatal: confused by unstable object source data”

Either one or more files are being modified during your operation, or something is causing inconsistent reads (e.g. failing hardware). Short version: Git’s developers did not intend for it to be used on volatile files. Due to the layout* that Git uses for “loose objects” and the limited filesystem semantics that it assumes**, Git must … Read more

Git tab completion in zsh throwing errors

It seems that the git-completion.zsh is not designed to be sourceed. You could copy the git-completion.zsh file to somewhere in the $fpath and rename it to _git instead. For example: (if you decide to have ~/.zsh/functions/_git.) First, you could copy the git-completion.zsh to there and rename it to _git. % mkdir -p ~/.zsh/functions && cp … Read more

How to do git cherry-pick –continue in SourceTree?

cherry-pick effectively applies the changes from commit A onto the working tree and makes a commit. This means if you get any conflicts during cherry-picking you need to commit after resolving them to finish the cherry-pick. EDIT Edward noted that this is only true when you are cherry-picking a single commit. When picking multiple commits … Read more

Sync all branches with git

I think you want to: git fetch –all -Pp where: git fetch Download objects and refs from another (remote) repository –all fetch all remotes. -P remove any remote-tracking references that no longer exist on the remote. -p remove any local tags that no longer exist on the remote. for more use git fetch –help We … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)