GIT how to update branches with different files

I’m having a master branch with english texts and another branch called german_translation.

The german branch is identical with the master branch – but the german branch has an additional folder /value-de with one file in it strings.xml.

When adding new stuff to the master branch, I want to update the german branch with the new stuff from master and add new translation text to the german strings.xml.

My problem is that a merge is not working because of that extra file and folder the german branch has.

Is that a un/stash thing?
However can you describe the full steps going throu this branch update process?

Thanks in advance!

EDIT: This is the error message I’m getting

Can’t merge because of unmerged files. You have to resolve all merge conflicts before merge. After resolving conflicts you also probably would want to commit your files to the current branch.

EDIT2: (that’s german …)

git status

# Auf Branch german_translation
# Sie haben nicht zusammengeführte Pfade.
#  (beheben Sie die Konflikte und führen Sie "git commit" aus)
# zum Commit vorgemerkte Änderungen:
#       geändert:   src/main/res/values/strings.xml
# Nicht zusammengeführte Pfade:
#   (benutzen Sie "git add/rm <Datei>..." um die Auflösung entsprechend zu markieren)
#       von denen gelöscht: src/main/res/values-de/strings.xml

  • How to find the Sizes of stash repositories
  • Preview changes stash will make to current HEAD without applying
  • Git: Create a branch from unstaged/uncommited changes on master
  • Git: How to recover stashed uncommitted changes
  • Git: Stash just a single file
  • git stash blunder: git stash pop and ended up with merge conflicts
  • git diff stash@{0} shows changes - git stash apply does not change the working tree
  • Why isn't the git stash unique per branch?
  • One Solution collect form web for “GIT how to update branches with different files”

    One possibility is that the file values-de/strings.xml was at one point present on the master branch, and subsequently deleted. In the meantime, on the german translation branch, the same file had updates not present on the master branch.

    When the next merge from master occurred, it included the delete operation for the values-de/strings.xml, but since there are updates on the branch, it couldn’t be completed, instead resulting in a merge conflict.

    Right now git is asking you to resolve this merge conflict manually, i.e., which takes precedence, the deletion of the file, or the changes made to it on this branch?

    If you want to keep the file with the changes, then execute

    git add src/main/res/values-de/strings.xml
    git commit

    if not, you would execute:

    git rm src/main/res/values-de/strings.xml
    git commit

    This would complete your last merge, so now you can merge again to get the latest.

    Also, you may want to consider keeping your german translation in the master branch. Branches are generally for keeping past versions or for feature development.

    Git Baby is a git and github fan, let's start git clone.