Re: [git-users] after pulling from remote, move last commit into a new branch and push
On Sat, Apr 22, 2023 at 7:53 AM Uwe Brauer wrote: > I pulled for a remote server and obtained > > * commit b7007223bd7c99b9d92911c66411b2143a791ce4 (master) (origin/master, > origin/HEAD, master) > | Author: John Ciolfi > | Date: Mon Apr 10 16:05:31 2023 -0400 > | > | matlab and org mode example > | > > > So I wanted to create a new branch org-mode so that this commit should > be in the new branch and later add other commits to that branch. > > So I run > > git branch org-mode > git checkout master > git reset --hard HEAD~1 > git checkout org-mode > git push -u origin org-mode You pushed the "org-mode" branch, but you changed the "master" branch, and you didn't push it. > * commit b7007223bd7c99b9d92911c66411b2143a791ce4 (master) (origin/master, > origin/HEAD, master) > | Author: John Ciolfi > | Date: Mon Apr 10 16:05:31 2023 -0400 > | > | matlab and org mode example > | > > So commit b7000 belongs to master not to org-mode as I hoped, what did I > miss? You changed the "master" branch locally, but you didn't update it on the remote repository. -- Felipe Contreras -- 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/CAMP44s3na%2BUBthjPNSx2xuuUzDYkAWn-doHS-M8iAwZ9_7QQ1w%40mail.gmail.com.
[git-users] after pulling from remote, move last commit into a new branch and push
Hi I pulled for a remote server and obtained * commit b7007223bd7c99b9d92911c66411b2143a791ce4 (master) (origin/master, origin/HEAD, master) | Author: John Ciolfi | Date: Mon Apr 10 16:05:31 2023 -0400 | | matlab and org mode example | So I wanted to create a new branch org-mode so that this commit should be in the new branch and later add other commits to that branch. So I run git branch org-mode git checkout master git reset --hard HEAD~1 git checkout org-mode git push -u origin org-mode Then I in another directory I cloned the remote repository again in order to check whether everything is fine. It looked. So git switch -c org-mode -t origin/org-mode I edited committed and pushed But now * commit 2338bb2167f7e2e2b078be3d8906507794b5752f (org-mode) (HEAD -> org-mode, origin/org-mode) | Author: Uwe Brauer | Date: Sat Apr 22 14:37:02 2023 +0200 | | Add org file, that describe how to use the python engine not the native one | * commit b7007223bd7c99b9d92911c66411b2143a791ce4 (master) (origin/master, origin/HEAD, master) | Author: John Ciolfi | Date: Mon Apr 10 16:05:31 2023 -0400 | | matlab and org mode example | So commit b7000 belongs to master not to org-mode as I hoped, what did I miss? Thanks 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/871qkct6xe.fsf%40mat.ucm.es. smime.p7s Description: S/MIME cryptographic signature