How to find last merge in git?

git log –merges -n 1 works well. From man git-log: –merges Print only merge commits. This is exactly the same as –min-parents=2. Here’s an example using –pretty=format:”%H” to get just the SHA. $ git log –pretty=format:”%H” –merges -n 1 f32e1f13eef7d5843e8063b8709d01af6dcd5dbf Credit goes to Jefromi for their comment on another answer.

Git repository lost its remote branches?

[Edit, April 2017] If you made your original clone with –single-branch, your remote.origin.fetch setting will be the problem. If you used a –depth limit, that too implies –single-branch. Restore the normal remote.origin.fetch value described below and you will get a fuller clone. Normally, just running git fetch should restore your remote-tracking branches. If git fetch … Read more

Git submodules: specify a specific SHA?

Submodules, by definition, always reference particular SHA1 in the subproject. That SHA1 isn’t expressed in the .gitmodules file, but is instead expressed as the entry in the tree object that contains the submodule. The way you set this in git is by cding into the submodule, checking out the SHA1 you want, then cding back … Read more

how to automate the “commit-and-push” process? (git)

You can very easily automate this using Bash scripting. git add . echo ‘Enter the commit message:’ read commitMessage git commit -m “$commitMessage” echo ‘Enter the name of the branch:’ read branch git push origin $branch read store the above code as a .sh file(say gitpush.sh) And since you have to make this sh file … Read more

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