How to commit code in multiple branches in Source Tree - branching-and-merging

I have some code which I have already committed in say branch X. How do I commit the same code in Branch Y ? Is there any way to commit same code in multiple branches at the same time?

You can add the same commit using cherry-pick on you new branch.
Doc:
http://git-scm.com/docs/git-cherry-pick
Explained:
http://think-like-a-git.net/sections/rebase-from-the-ground-up/cherry-picking-explained.html

Related

difference between SmartGit "revert" and "revert & commit"

I have edits and a commit I want to undo.
SmartGit offers "revert" and it also offers "revert & commit". What is the difference?
Do either of these modify source code or are they strictly changes within Git itself.
Both Revert and Revert & Commit will modify your source code in the working tree. Revert & Commit will -- in addition -- also immediately commit these modifications. With Revert you have to manually Commit yourself. The advantage of Revert is that you can tweak your commit, if necessary. Also, Revert & Commit may be unable to actually perform the commit due to conflicts.

Neo4j: How do you find the first (shallowest) match for all relationship matches?

I have a data set that duplicates the commit history inside a git repository. Each Commit node has one or more parents, which are also Commit nodes. Commits have a commit_id property and have references to the files that changed in that commit. In other words:
ChangedFile<-[:CHANGED_IN]-Commit
Commit-[:CONTAINS]->ChangedFile
Commit-[:CHILD_OF]->Commit
I'm now trying to write a Cypher query that returns commit/file pairs where each commit contains the most recent change to the file. Since the graph has been designed to mimic git history with parent/child relationships, the query should support choosing a commit to start at, i.e. the HEAD.
Here's what I've got so far:
MATCH
(commit:Commit {commit_id: '460665895c91b2f9018e361b393d7e00dc86b418'}),
(file:ChangedFile)<-[:CHANGED_IN]-commit-[:CHILD_OF*]->(parent:Commit)
RETURN
file.path, parent.commit_id
Unfortunately this query returns all the commits that match at any number of levels deep within the [:CHILD_OF*] relationship. I want it to instead stop at the first match for each file. As things stand now, I end up seeing a bunch of duplicate file paths in the result set.
How do I tell Neo4j/Cypher to stop at the first match per file, regardless of depth? I've tried adding UNIQUE and a bunch of other things, but I can't seem to find something that works. Thanks in advance!
Maybe I'm misunderstanding your data model and what you are after, but why are you looking for variable length paths from the commit to its parent? Aren't you just looking for the parent?
MATCH
(commit:Commit {commit_id: '460665895c91b2f9018e361b393d7e00dc86b418'}),
(file:ChangedFile)<-[:CHANGED_IN]-commit-[:CHILD_OF]->(parent:Commit)
RETURN
file.path, parent.commit_id

Bazaar Version Control deletes files

I'm a single user looking into Bazaar Explorer gui. Consider this scenario:
Create repository.
Create FileOne and add.
Commit as rev 1.
Make changes to FileOne.
Commit as rev 2.
Create and add FileTwo.
Commit as rev 3.
Now, let's say that FileOne has problems and I want to revert to rev 1. If I do this FileTwo will be deleted. If I want to keep FileTwo I guess I can copy it somewhere outside of version control, revert to rev 1, and then add FileTwo back to version control. This seems clumsy to me. Is there a better way of doing this? Thanks..
You can do one of the following:
First, selectively revert FileOne, e.g.:
bzr revert -r 1 FileOne
bzr commit
This will restore FileOne to the way it was in revision 1.
Second, use reverse cherrypicking:
bzr merge -r 2..1
bzr commit
This will create a patch that inverts the change of going from revision 1 -> 2.
Either option will create a new commit, but with the changes made in revision 2 undone.

HBase: major_compact not working properly

When I run a major compaction in Apache HBase, it is not deleting rows marked for deletion unless I first perform a total reboot of HBase.
First I delete the row I want and subsequently perform a scan to see that the row I want is marked for deletion:
column=bank:respondent_name, timestamp=1407157745014, type=DeleteColumn
column=bank:respondent_name, timestamp=1407157745014, value=STERLING NATL MTGE CO., INC
Then I run the command major_compact 'myTable' and wait a couple of minutes for the major compaction to finish in the background. Then when I perform the scan again, the row and tombstone marker are still there.
However, if I restart HBase and run another major compaction, the row and tombstone marker disappear. In a nutshell, major_compact only seems to be working properly if I perform a restart of HBase right before I run the major compaction. Any ideas on why this is the case? I would like to see the row and tombstone marker be deleted every time I run a major compaction. Thanks.
My experience is to flush the table firstly before run major_compact for this table
hbase>flush 'table'
hbase>major_compact 'table'
Step 1. create table
create 'mytable', 'col1'
Step 2. insert data into table
put 'mytable',1,'col1:name','srihari'
Step 3. Flush the table
flush 'mytable'
Observe one file in below location
Location : /hbase/data/default/mytable/*/col1
Repeat the step 2 and 3 one more time and observe the location we can see two files in that location.
Now execute the below command
major_compact 'mytable'
Now we can see only one file in that location.

TFS - Merge relationship - How to exclude ?

We have a case here where a developer creates a wrong branch. The branch should be: $\projectA\branch01\pg5Dev from $\projectA\main\pg5Dev\ but he creates a $\projectA\branch01\ from $\projectA\main\pg5Dev.
We deleted the folder and creates the branch again, but the merge relationship in merge wizard remains.
We need to know the database structure of Merge Relations ships to remove $\projectA\branch01\, because everytime we will make a merge, the worng branch is appearing in combobox of merge wizard.
Please, help us identify the tables in database that have this wrong record.
If the incorrect branch isn't needed then I would recommend destroying it. Once it is destroyed, it will no longer show up in the combobox. You can destroy it by running "tf destroy ". Note that a destroy is non-recoverable and it will delete all of the history for that branch.

Resources