Update Git branches from master

You have two options: The first is a merge, but this creates an extra commit for the merge. Checkout each branch: Then merge: Then push: Alternatively, you can do a rebase:

Git error when trying to push — pre-receive hook declined

ou should ask whoever maintains the repo at git@mycogit/cit_pplus.git. Your commits were rejected by the pre-receive hook of that repo (that’s a user-configurable script that is intended to analyze incoming commits and decide if they are good enough to be accepted into the repo). It is also a good idea to ask that person to update the hook, so … Read more

How can I merge multiple commits onto another branch as a single squashed commit?

Say your bug fix branch is called bugfix and you want to merge it into master: This will take all the commits from the bugfix branch, squash them into 1 commit, and merge it with your master branch. Explanation: Switches to your master branch. Takes all commits from the bugfix branch and groups it for a 1 commit with your current branch.(no merge commit appears; you … Read more

What would I use git-worktree for?

For me, git worktree is the biggest improvement since a long time. I’m working in enterprise software development. There, it is very common that you have to maintain old versions like what you released 3 years ago. Of course you have a branch for each version so that you can easily switch to it and … Read more

How to fetch all Git branches

You can fetch all branches from all remotes like this: It’s basically a power move. fetch updates local copies of remote branches so this is always safe for your local branches BUT: fetch will not update local branches (which track remote branches); if you want to update your local branches you still need to pull every branch. fetch will not create local branches (which track remote branches), you … Read more

Hard reset of a single file

You can use the following command: … which will update both the working copy of my-file.txt and its state in the index with that from HEAD. — basically means: treat every argument after this point as a file name. More details in this answer. Thanks to VonC for pointing this out.

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