Re: [git-users] a new branch created, with interrupts the graph
On Mon, Feb 06, 2023 at 07:49:40PM +0100, Uwe Brauer wrote: > My answer was cut in the middle I resend it later sorry Quite possibly we've hit this very case where a real picture would help. I think you could make a screenshot of any GUI front-end to Git. Say, running gitk main default would fit the bill. -- You received this message because you are subscribed to the Google Groups "Git for human beings" group. To unsubscribe from this group and stop receiving emails from it, send an email to git-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/git-users/20230206185741.56pw6pfj3la6syof%40carbon.
Re: [git-users] a new branch created, with interrupts the graph
My answer was cut in the middle I resend it later sorry Sent from my iPhone > On 6. Feb 2023, at 19:33, Uwe Brauer wrote: > > >>> On Mon, Feb 06, 2023 at 03:13:55PM +0100, Uwe Brauer wrote: >> >> I'm not sure I follow as I failed to parse what does "interrupted the graph" >> stands for, but let me have a guess. > > Oh this is essential, usually "*" stands for a commit and commits are > connected by > | > | > > > In this case > , > | * commit 03ef0f5985d30b598d808b68e1ec85a0bb405d71 (main~12) > | Author: XXX > | > | Limpiar commits > | > | * commit d81bd81b396096fc02aac874a75bccd656183a99 (remotes/origin/default) > (origin/default) > | | Author: > | | > | | Quitar plot mirk4 > | | > ` > > > There is a hole, two commits 03ef0f and d81bd81b396096fc0 > > Are not connected by > | > | > > I don't recall having seen this before. This is why I asked. -- You received this message because you are subscribed to the Google Groups "Git for human beings" group. To unsubscribe from this group and stop receiving emails from it, send an email to git-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/git-users/B3534CD6-E129-4C74-A337-07176FF5C2AF%40mat.ucm.es.
Re: [git-users] a new branch created, with interrupts the graph
> On Mon, Feb 06, 2023 at 03:13:55PM +0100, Uwe Brauer wrote: > I'm not sure I follow as I failed to parse what does "interrupted the graph" > stands for, but let me have a guess. Oh this is essential, usually "*" stands for a commit and commits are connected by | | In this case , | * commit 03ef0f5985d30b598d808b68e1ec85a0bb405d71 (main~12) | Author: XXX | | Limpiar commits | | * commit d81bd81b396096fc02aac874a75bccd656183a99 (remotes/origin/default) (origin/default) | | Author: | | | | Quitar plot mirk4 | | ` There is a hole, two commits 03ef0f and d81bd81b396096fc0 Are not connected by | | I don't recall having seen this before. This is why I asked. -- You received this message because you are subscribed to the Google Groups "Git for human beings" group. To unsubscribe from this group and stop receiving emails from it, send an email to git-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/git-users/87ttzybq3u.fsf%40mat.ucm.es. smime.p7s Description: S/MIME cryptographic signature
Re: [git-users] a new branch created, with interrupts the graph
On Mon, Feb 06, 2023 at 03:13:55PM +0100, Uwe Brauer wrote: > I just pulled from a repository in which a user created a new branch (and he > should not) but interrupted the graph. So it looks using > > > git log --since=2years --graph --color=always --all --decorate --pretty=short > | git name-rev --annotate-stdin | less -R > > As follows: the graph starts like > > * commit 962fe4d0665264e16cca975d0d3a0f887a91ee99 (main) (HEAD -> main, > origin/main, origin/HEAD) > | Author: XXX > | > | correción función plot > > The branch finished like this > And branch finished like > * commit a6ca1af6e8db2e96153a918c9bb9b40f02ccd787 (main~11) > | Author: XXX > | > | funcion mieuler > | > * commit 03ef0f5985d30b598d808b68e1ec85a0bb405d71 (main~12) > Author: Hugo Del Castillo Mola > > Limpiar commits > > * commit d81bd81b396096fc02aac874a75bccd656183a99 (remotes/origin/default) > (origin/default) > | Author: XXX > | > | Quitar plot mirk4 > | > > > > Now I don't want him to use a branch called main. > > (I am using mercurial and the hg-git plugin, so it is much easier for me > if the main branch is called default, I omit the reasons. > > Now I cannot merge his main branch into default, well I can but there > are so many merge conflicts, that I refuse to solve them. So what is the > best way to solve this > > 1. Merge and then reset git to his change set? > > 2. Rename his branch again to default (but I am afraid that git gets >confused with the local branch called default and the one on >origin.) > > So any suggestion would be very much appreciated. I'm not sure I follow as I failed to parse what does "interrupted the graph" stands for, but let me have a guess. To me, looks like you the "main" branch completely contains the history of the "default" branch - that is, basically you have ...-->E-->F-->G-->H-->I-->J-->K ^ ^ default's tip main's tip It's easy to check that by running git branch -r --contains default if origin/main is listed, that's it. If so, a mere git push origin main:default would make sure the branch "default" in the remote repo now points at the same commit as "main". If this sounds too hardcore, do git checkout default git merge --ff-only main git push origin default That "--ff-only" instructs `git merge` to perform a so-called "fast-forward" merge which is not really a merge but rather repositioning of the branch pointer. Basically, if "main" is contained in "default" would make Git to merge FF merge by default, so "--ff-only" is merely a reassurement check: the command will fail if the merge would not be fast-forward. -- You received this message because you are subscribed to the Google Groups "Git for human beings" group. To unsubscribe from this group and stop receiving emails from it, send an email to git-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/git-users/20230206182414.prvmfrgg4zwdi4gh%40carbon.
[git-users] a new branch created, with interrupts the graph
Hi I just pulled from a repository in which a user created a new branch (and he should not) but interrupted the graph. So it looks using git log --since=2years --graph --color=always --all --decorate --pretty=short | git name-rev --annotate-stdin | less -R As follows: the graph starts like * commit 962fe4d0665264e16cca975d0d3a0f887a91ee99 (main) (HEAD -> main, origin/main, origin/HEAD) | Author: XXX | | correción función plot The branch finished like this And branch finished like * commit a6ca1af6e8db2e96153a918c9bb9b40f02ccd787 (main~11) | Author: XXX | | funcion mieuler | * commit 03ef0f5985d30b598d808b68e1ec85a0bb405d71 (main~12) Author: Hugo Del Castillo Mola Limpiar commits * commit d81bd81b396096fc02aac874a75bccd656183a99 (remotes/origin/default) (origin/default) | Author: XXX | | Quitar plot mirk4 | Now I don't want him to use a branch called main. (I am using mercurial and the hg-git plugin, so it is much easier for me if the main branch is called default, I omit the reasons. Now I cannot merge his main branch into default, well I can but there are so many merge conflicts, that I refuse to solve them. So what is the best way to solve this 1. Merge and then reset git to his change set? 2. Rename his branch again to default (but I am afraid that git gets confused with the local branch called default and the one on origin.) So any suggestion would be very much appreciated. Regards Uwe Brauer -- Warning: Content may be disturbing to some audiences I strongly condemn Putin's war of aggression against the Ukraine. I support to deliver weapons to Ukraine's military. I support the ban of Russia from SWIFT. I support the EU membership of the Ukraine. https://addons.thunderbird.net/en-US/thunderbird/addon/gmail-conversation-view/ -- You received this message because you are subscribed to the Google Groups "Git for human beings" group. To unsubscribe from this group and stop receiving emails from it, send an email to git-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/git-users/87fsbidgpo.fsf%40mat.ucm.es. smime.p7s Description: S/MIME cryptographic signature