1

I'm still learning git and currently just using it as a single user. I find it to be a good way to test out some features and separate the dev into branches..

Would it be possible to do the following marked with red?

enter image description here

I want to rename the files that I have changed in the 2nd branch - the change should be both in the 1st and 2nd branch...

Norfeldt
  • 8,272
  • 23
  • 96
  • 152
  • 1
    i don't see any "1st branch" or "2nd branch" in your graphics, so the text doesn't make sense (and I have the suspicion, that what you want can be expressed in words without graphics) – umläute Jan 02 '17 at 20:02
  • Am I misunderstanding something, or are you just talking about merging two branches? – michaeljt Jan 02 '17 at 20:04
  • Say I have File A with some working code on the 1st branch. I make a 2nd branch to try out some major code changes in file A. I then realized that it would have been better calling it B. If I go back to 1st branch rename A to B. Go back to 2nd branch and do a merge with 1st branch I'll get 2 files: File A (old name, but new major changed code - still not working code) and File B (new name, but old code)... – Norfeldt Jan 02 '17 at 20:11
  • Please [edit] your post to add any additional information you have to your question. Avoid adding this in the comments, as they are harder to read and can be deleted easier. – Scott Weldon Jan 03 '17 at 00:27

1 Answers1

0

What you want to do is simply called merging in git speak.

Git does a quite good job for tracking file-renames, so in most cases it will correctly figure out that you have changed the content in fileA in one branch and renamed fileA to fileB in another branch. Doing a merge should then rename the file and incorporate the rename.

However, for this to work, the renamed file must be either sufficiently similar (so git has a chance to note that this is meant to be the same file), or you must trigger a rename explicitely via git mv

See also

Community
  • 1
  • 1
umläute
  • 28,885
  • 9
  • 68
  • 122