commit

git log <filename> doesn't show commit, but git log shows commit that edited the file

跟風遠走 提交于 2020-01-15 12:33:22
问题 I discovered this odd issue while looking for a lost change. I typed in: git log httpd.conf I am getting a bunch of commit hashes as expected, but not the one I did. When I type in: git log I see the commit I made. When I run: git show <hash> I see my edits to httpd.conf Can anyone explain what may have happened? If there is more information needed to discover the root please let me know. 回答1: From git docs (http://git-scm.com/docs/git-log): Default mode - simplifies the history to the

mysql commit and transaction

扶醉桌前 提交于 2020-01-12 07:46:14
问题 I have a question regarding mysql commits and transactions. I have a couple of php statements that execute mysql queries. Do I just say the following? mysql_query("START TRANSACTION"); //more queries here mysql_query("COMMIT"); What exactly would this do? How does it help? For updates, deletes and insertions I also found this to block other queries from reading: mysql_query("LOCK TABLES t1 WRITE, t2 WRITE"); //more queries here mysql_query("UNLOCK TABLES t1, t2"); Would this block other

Do a Git pull to overwrite local changes

眉间皱痕 提交于 2020-01-11 15:41:11
问题 There has certainly been posts around for this, but I actually did a commit because I thought it was the right thing to do. So, I have two repositories, one development and one production. I had to edit something in the production because it was an urgent bugfix, and now I have three files that are newer in the production than in the development. I committed the three files on the production and tried a pull, but it told me there were merge errors. I tried copying and pasting the new files to

Build on commit with subversion

妖精的绣舞 提交于 2020-01-10 09:21:30
问题 Simple question. I use Visual studio and I've just installed subversion, how can i force the project to be build with msbuild, and if successfully build commit it else warn the user. I would use TortoiseSVN or VisualSVN or AnkhSVN (whatever it's called) if they have the ability to force build on commit built-in (I know that this is not their usage, I know they are just used as just GUI for committing to SVN) I would like to know if any of these tools can be used to do this extra thing. To

Move commits from master onto a branch using git

余生颓废 提交于 2020-01-09 06:04:30
问题 I'm trying to learn how to use Git effectively and I'm wondering how I should (good practice/bad practice?) solve the following case: Say I have the following chain of commits in master: Initial commit Commit 1 Commit 2 Commit 3 Then I realize that what's done in the last two commits is completely wrong and I need to start from Commit 1 again. Questions: How should I do that? Can I move Commit 2 and 3 to a separate branch to keep for future reference (say they weren't that bad after all) and

How to write a Git pre-commit hook that prevents committing of an Android project if the test project fails?

旧巷老猫 提交于 2020-01-03 03:07:30
问题 Given that I in my workspace I have an android project MyAndroidProject and my tests project MyAndroidProjectTests directories how could I write a pre-commit git hook that will run the tests in the MyAndroidProjectTests and refuse to commit any code changes if the tests fail? When I run tests on the terminal they usually have output like this: com.mydomain.tests.Models.MyProjectTests:....... Test results for InstrumentationTestRunner=....... Time: 0.05 OK (10 tests) What I'm unsure about is

Can a script be automated after a commit on Perforce?

与世无争的帅哥 提交于 2020-01-02 09:56:27
问题 We use Perforce at work, and routinely keep software projects in the repository. In general creators follow the normal Perforce flow, BUT we also have a class of users, who doesn't have any need to edit the files but only read them. Currently we use P4Web but that requires the user so download each file individually to reassemble the project directory. Ideally I would like to have a process where when a user does a commit/submit in Perforce, the script would automatically run to generate a

Git Commit during Git Rebase - what really happens?

萝らか妹 提交于 2020-01-02 01:41:11
问题 I'm looking for a good description of what happens if one commits during rebase and how this could be 'reverted' in an easy way. Let's consider a scenario, where a large commit is rebased. During rebase a conflict appears and user begins merging changes. Now, imagine a scenario where you were almost done, but you didn't call git rebase --continue - for whatever reason (be it long weekend or such). The next week you just resumed working, stil during rebase. Finally, you call git commit --amend

CakePHP 2.3.x database transaction

末鹿安然 提交于 2020-01-01 10:49:27
问题 I need your help using transactions in CakePHP. I have a Product model, with clause hasMany to Price and Property models (key product_id). In my Product model, I add function begin() { $db =& ConnectionManager::getDataSource($this->useDbConfig); $db->begin($this); } function commit() { $db =& ConnectionManager::getDataSource($this->useDbConfig); $db->commit($this); } function rollback() { $db =& ConnectionManager::getDataSource($this->useDbConfig); $db->rollback($this); } And in

Updating docker images with small changes using commits

穿精又带淫゛_ 提交于 2020-01-01 08:44:59
问题 I want to leverage caching/layering of docker images to save bandwidth, disk space, and time spent. Let say: I've a web-app docker image installed and deployed into several docker hosts. The docker image contains source code of my web app. I worked on the code, and now have a new version of the code. How should I automate the creation of a new docker commit above last image containing only the bugfix ? My goal is that only the small bugfix diff will be required to download to get the new