commit

Git commit against tag with no branch

末鹿安然 提交于 2019-12-02 14:21:48
If I check out a tagged version of my source code without creating a branch, Git indicates that I'm not associated with any branch at all. It's happy to let me make changes and check them in though. Where do those changes go? If I switch back to 'master' they disappear (overwritten by what was in master) and I can't seem to find them again. What gives? If Git lets me commit changes against what's essentially an anonymous branch, surely I can get them back? Paul Because your commit isn't on any branch , you can't see it in the working directory unless you checkout that specific commit, using

How to add multiple files to Git at the same time

别说谁变了你拦得住时间么 提交于 2019-12-02 13:53:01
This will be my first git use. I have added new files ( a lot ) to the folder/project ( git local repository). I went through online tutorials and forums and see i can do git commit -a So i go to the base folder of the repository and do a sudo git commit -a But then, some screens comes up and asks me to add a comment which i do. i do not know how to proceed or exit. I do not want to mess up so i did ctrl + Z and did not do anything. Can you guys please outline the commands i need to use? git commit -a and git push? To add all the changes you've made: git add . To commit them: git commit -m "MY

PDO Multiple queries: commit and rollback transaction

帅比萌擦擦* 提交于 2019-12-02 13:51:34
I need to fire 2 queries. currently I'm doing it like this: // Begin Transaction $this->db->beginTransaction(); // Fire Queries if($query_one->execute()){ if($query_two->execute()){ // Commit only when both queries executed successfully $this->db->commit(); }else{ $this->db->rollback(); } }else{ $this->db->rollback(); } Is this the correct approach? I'm not using any try..catch in my code will it make my code inappropriate or vulnerable for any situation? vhu Yes, your approach is correct. Using Try...catch may lead into cleaner and more readable code in some cases but your overall approach is

save old git repository versions

橙三吉。 提交于 2019-12-02 12:51:39
问题 For the project I'm working on, I need to save all the files of a specific version of a git repository. I've looked through a fair amount of information regarding git checkout but I can't figure out what that does to the files in the directory I have, let alone save the version of that specific commit. Does anyone know a way to get the files of a git repository at a specific commit? Thanks. 回答1: Do a "git export" (like "svn export")? git checkout [commit sha] git archive --format zip --output

How to list stats of resolved conflicts in a merge commit?

微笑、不失礼 提交于 2019-12-02 11:22:22
问题 In merging a branch, a conflict may happen which we should resolve to complete the merge. How can we list ONLY the stats of resolved conflicts in merge? 回答1: TL;DR answer: Just try. Branches have a zero cost in git so just create a couple of test_merge_source and test_merge_destination branches and start the merge. After 5-10 minutes you are either done or you still have a little/some/much left because a few/some/many conflicts occurred and you can choose to finish/discard the merge attempt.

How to list stats of resolved conflicts in a merge commit?

我们两清 提交于 2019-12-02 07:29:45
In merging a branch, a conflict may happen which we should resolve to complete the merge. How can we list ONLY the stats of resolved conflicts in merge? TL;DR answer: Just try. Branches have a zero cost in git so just create a couple of test_merge_source and test_merge_destination branches and start the merge. After 5-10 minutes you are either done or you still have a little/some/much left because a few/some/many conflicts occurred and you can choose to finish/discard the merge attempt. I am sorry to provide you with a negative answer, but the premise for your question is fundamentally flawed

Can a JOB be created dynamically inside a trigger?

天涯浪子 提交于 2019-12-02 06:52:30
问题 The execution of this trigger fails (it compiles but once I do the specified insert -> error) create or replace TRIGGER AFT_INSERT_TMP_TBL AFTER INSERT ON TMP_TBL REFERENCING OLD AS OLD NEW AS NEW FOR EACH ROW DECLARE V_SQL VARCHAR2(1000); A_NAME VARCHAR2(100); BEGIN A_NAME:='ANY_NAME'; V_SQL:='BEGIN DBMS_SCHEDULER.CREATE_JOB ( job_name => '''||A_NAME||''', job_type => ''PLSQL_BLOCK'', job_action => ''BEGIN DBMS_OUTPUT.PUT_LINE('||A_NAME||'); END;'', start_date => TIMESTAMP''2011-12-4 10:30

Git is using Vim for Commit messages

早过忘川 提交于 2019-12-02 05:45:06
问题 I have just started using git and when I git commit it uses the VIM text editor to change write the commit message. Is this normal? In the tutorials and examples I have read, nowhere has VIM been used. Is it because I'm using windows 7 64 bit edition? 回答1: If you did not set an editor via the $GIT_EDITOR environment variable, core.editor configuration variable, the $VISUAL or $EDITOR environment variables, it will use vi . 回答2: How can I set up an editor to work with Git on Windows? 回答3: It

Why does this PostgreSQL transaction give “WARNING: there is no transaction in progress”

无人久伴 提交于 2019-12-02 04:59:08
问题 I am running the transaction queries in code like this (simplified): try { runQuery("begin"); runQuery("some query ..."); runQuery("some other query ..."); runQuery("some more query ..."); runQuery("some extra query ..."); runQuery("commit"); } catch (e){ runQuery("rollback"); } Here is the list of statements from the postgres log file. Notice that first begin / commit works fine and the second commit gives the error mentioned in the subject: 2015-02-18 20:19:17 UTC [6459-7] vdsr@sails LOG:

save old git repository versions

浪尽此生 提交于 2019-12-02 04:24:06
For the project I'm working on, I need to save all the files of a specific version of a git repository. I've looked through a fair amount of information regarding git checkout but I can't figure out what that does to the files in the directory I have, let alone save the version of that specific commit. Does anyone know a way to get the files of a git repository at a specific commit? Thanks. KingCrunch Do a "git export" (like "svn export")? git checkout [commit sha] git archive --format zip --output /full/path/to/zipfile.zip master However, I don't know, why. Usually one use a vcs exactly