1

We are using clearcase and git for version control.
I have a situation where my fellow colleague has released few changes in a developer label in clear case. Now i want to pull those particular changes to git branch.

Is there a way to achieve this?

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
Daemon
  • 1,575
  • 1
  • 17
  • 37

1 Answers1

1

Yes, make a snapshot view with a config spec selecting that label.

Then from your separate git working tree folder, do

git --work-tree=path/to/snapshot/view add .

# or, to limit files added:
git --work-tree=path/to/snapshot/view add -- afile
git --work-tree=path/to/snapshot/view add -- a folder

That will instruct git to add files modifications from your snapshot view.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • this adds all the files. Can we pick only files which we need and see what is getting merge. With lot of files it becomes difficult to analyze – Daemon Jan 30 '17 at 07:49
  • @Daemon Sure: I have edited the answer. Just add those files (without doing a commit). If you don't like what you see, you always can reset the Git working tree. – VonC Jan 30 '17 at 07:51
  • Thanks. It helped a lot. But going through the process I realized as the changes shared from clear case are from outside of git world, this was more or less comparing two files and auto merge. Correct me if I am wrong. Also these answers helped http://stackoverflow.com/a/505130/2045438 and http://stackoverflow.com/a/5810874/2045438 Also is there a way to open a merge tool with git --work-tree – Daemon Jan 30 '17 at 13:31
  • @Daemon Correct: git add will do a (2-way) merge by default. You can also launch a compare tool (kdiff3 or other) and check for the diff yourself. – VonC Jan 30 '17 at 13:32