How do I get the Git commit count?

To get a commit count for a revision (HEAD, master, a commit hash): git rev-list –count <revision> To get the commit count across all branches: git rev-list –all –count I recommend against using this for build identifier, but if you must, it’s probably best to use the count for the branch you’re building against. That … Read more

Git: How to solve Permission denied (publickey) error when using Git?

If the user has not generated a ssh public/private key pair set before This info is working on theChaw but can be applied to all other git repositories which support SSH pubkey authentications. (See [gitolite][1], gitlab or github for example.) First start by setting up your own public/private key pair set. This can use either … Read more

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: git checkout b1 Then merge: git merge origin/master Then push: git push origin b1 Alternatively, you can do a rebase: git fetch git rebase origin/master

How do I clone a single branch in Git?

Note: the git1.7.10 (April 2012) actually allows you to clone only one branch: # clone only the remote primary HEAD (default: origin/master) git clone <url> –single-branch # as in: git clone <url> –branch <branch> –single-branch [<folder>] (<url> is the URL if the remote repository, and does not reference itself the branch cloned) You can see … Read more

Resetting remote to a certain commit

Assuming that your branch is called master both here and remotely, and that your remote is called origin you could do: git reset –hard <commit-hash> git push -f origin master However, you should avoid doing this if anyone else is working with your remote repository and has pulled your changes. In that case, it would … Read more

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