Re: Git Unrelated Histories

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Aug 29, 2018 at 9:49 AM Tomas Zubiri <me@xxxxxxxxxxxxxxx> wrote:
>
> Hello all,
>
> I have recently joined a team there seems to be a couple of  issue
> with the git repositories:
>
>
> 1- A branch created from development cannot be merged into the
> production branch.
>
>
>
> (production)
>
> git merge development_feature_branch
>
>
>
> fatal: refusing to merge unrelated histories
>

See the git merge man page for the
  --allow-unrelated-histories switch.

>
>
>
> 2- If there is a file that only has a 1 line difference in production,
> a git diff will return that the whole file is different:
>
> git diff production:folder development:folder
>
>
>
> diff --git a/folder/file.py b/folder/file.py
>
> index 9bfd6612..20cce520 100644
>
> --- a/folder/file py
>
> +++ b/folder/file.py
>
> @@ -1,245 +1,245 @@
>
>
>
> I’m not 100% sure what happened here. But it seems that changes and
> added files are copied and pasted into the production branch and
> uploaded indepenedently as separate files, contributing to a huge
> difference between branches.

It sounds to me as if there would be line ending issues or some sort
of whitespace issues (tab vs spaces).

>
> How can I confirm this hypothesis, and what steps can I take to solve it?

git diff --ignore-all-space
or --ignore-space-at-eol

Look at gitattributes to set your flavor for files so you don't have
to pass these flags all the time

Stefan




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux