1

I am new to git.

I have an issue where I get this message when I checked out a local branch:

Your branch and 'origin/master' have diverged,
and have 5 and 4 different commits each, respectively.
  (use "git pull" to merge the remote branch into yours)

My concern is if I pull changes from the remote and merge it to my local branch will it affect any of my changes I have made in my local?

I have been reading around and the closest is probably this but it did not answer my concern.

Community
  • 1
  • 1
SeekingAlpha
  • 7,489
  • 12
  • 35
  • 44

1 Answers1

1

Hi you can create a new branch from your current branch with:

git branch my_changes

later you can pull the branch,(for example master) now if the merge generate a conflict you can resolve them, but only your real change is in branch "my_changes"

if you want switch your change branch you can type

git checkout my_changes
archetipo
  • 579
  • 4
  • 10