8 Replies Latest reply: Mar 27, 2012 4:09 AM by Andy Taylor RSS

    git-help me please?

    Clebert Suconic Master

      It's urgent please!

       

      Seriously .. I know I need to RTFM.. but one thing I couldn't figure out:

       

       

      Why this crashed my repository:

       

      I (unadvertedly) typed:

       

      git pull --rebase upstream

       

      (without any branch)

       

       

      And that duplicated all my branches, and I couldn't checkout any branches after this.. I had to re-download my copy after this.

       

      Any idea what I did wrong, why it broke my clone and how I would fix it?

        • 1. Re: git-help me please?
          Jeff Mesnil Master

          Clebert Suconic wrote:

           

          It's urgent please!

           

          Seriously .. I know I need to RTFM.. but one thing I couldn't figure out:

           

           

          Why this crashed my repository:

           

          I (unadvertedly) typed:

           

          git pull --rebase upstream

           

          (without any branch)

           

          And that duplicated all my branches, and I couldn't checkout any branches after this.. I had to re-download my copy after this.

           

          Any idea what I did wrong, why it broke my clone and how I would fix it?

           

          what "git branch" is saying?

          what do you mean you could not checkout any branch? You mean "git checkout <branch>"? (I'm asking because a git checkout is nothing like a svn checkout)

          what's the error?

          • 2. Re: git-help me please?
            Clebert Suconic Master

            If I do this:

             

            git pull --rebase upstream

             

            (no branch)

             

             

            git will do this:

             

            From git://github.com/hornetq/hornetq

            * [new branch]      20-optimisation -> upstream/20-optimisation

            * [new branch]      2_2_0_HA_Improvements -> upstream/2_2_0_HA_Improvements

            * [new branch]      2_2_0_HA_Improvements_preMerge -> upstream/2_2_0_HA_Improvements_preMerge

            * [new branch]      Branch_2_1 -> upstream/Branch_2_1

            * [new branch]      Branch_2_1_inactive_dont_use -> upstream/Branch_2_1_inactive_dont_use

            * [new branch]      Branch_2_2_2_REST -> upstream/Branch_2_2_2_REST

            * [new branch]      Branch_2_2_2_REST@10429 -> upstream/Branch_2_2_2_REST@10429

            * [new branch]      Branch_2_2_2_REST@10431 -> upstream/Branch_2_2_2_REST@10431

            * [new branch]      Branch_2_2_2_REST@10432 -> upstream/Branch_2_2_2_REST@10432

            * [new branch]      Branch_2_2_2_REST@10600 -> upstream/Branch_2_2_2_REST@10600

            * [new branch]      Branch_2_2_AS7 -> upstream/Branch_2_2_AS7

            * [new branch]      Branch_2_2_EAP -> upstream/Branch_2_2_EAP

            * [new branch]      Branch_2_2_EAP-cluster-cleanup -> upstream/Branch_2_2_EAP-cluster-cleanup

            * [new branch]      Branch_2_2_EAP_HORNETQ-685 -> upstream/Branch_2_2_EAP_HORNETQ-685

            * [new branch]      Branch_2_2_EAP_HORNETQ-787 -> upstream/Branch_2_2_EAP_HORNETQ-787

            * [new branch]      Branch_2_2_EAP_cluster4 -> upstream/Branch_2_2_EAP_cluster4

            * [new branch]      Branch_2_2_EAP_cluster_clean2 -> upstream/Branch_2_2_EAP_cluster_clean2

            * [new branch]      Branch_2_2_EAP_cluster_clean3 -> upstream/Branch_2_2_EAP_cluster_clean3

            * [new branch]      Branch_2_2_EAP_export_tool -> upstream/Branch_2_2_EAP_export_tool

            * [new branch]      Branch_2_2_EAP_hq782 -> upstream/Branch_2_2_EAP_hq782

            * [new branch]      Branch_Large_Message_Compression -> upstream/Branch_Large_Message_Compression

            * [new branch]      Branch_New_Paging -> upstream/Branch_New_Paging

            * [new branch]      Branch_New_Paging_preMerge -> upstream/Branch_New_Paging_preMerge

            * [new branch]      Branch_Replication_Changes -> upstream/Branch_Replication_Changes

            * [new branch]      ClebertCallback -> upstream/ClebertCallback

            * [new branch]      ClebertTemporary -> upstream/ClebertTemporary

            * [new branch]      Clebert_Sync -> upstream/Clebert_Sync

            * [new branch]      Clebert_TMP -> upstream/Clebert_TMP

            * [new branch]      HORNETQ-129_STOMP_protocol -> upstream/HORNETQ-129_STOMP_protocol

            * [new branch]      HORNETQ-316 -> upstream/HORNETQ-316

            * [new branch]      HORNETQ-316_for-r11196 -> upstream/HORNETQ-316_for-r11196

            * [new branch]      HORNETQ-316_for_2_2_EAP -> upstream/HORNETQ-316_for_2_2_EAP

            * [new branch]      HORNETQ-316_old -> upstream/HORNETQ-316_old

            * [new branch]      HORNETQ-515 -> upstream/HORNETQ-515

            * [new branch]      HORNETQ-681 -> upstream/HORNETQ-681

            * [new branch]      HORNETQ-720_Replication -> upstream/HORNETQ-720_Replication

            * [new branch]      HORNETQ_650 -> upstream/HORNETQ_650

            * [new branch]      HnetQ_323_cn -> upstream/HnetQ_323_cn

            * [new branch]      Hornet_194 -> upstream/Hornet_194

            * [new branch]      Hornet_194_Replication_reinit_old -> upstream/Hornet_194_Replication_reinit_old

            * [new branch]      NEW_PAGING -> upstream/NEW_PAGING

            * [new branch]      Replication_Clebert -> upstream/Replication_Clebert

            * [new branch]      STOMP11    -> upstream/STOMP11

            * [new branch]      STOMP11_PERF -> upstream/STOMP11_PERF

            * [new branch]      hornetq-416 -> upstream/hornetq-416

            * [new branch]      hornetq_grouping -> upstream/hornetq_grouping

            * [new branch]      i18n_logging -> upstream/i18n_logging

            * [new branch]      master     -> upstream/master

            * [new branch]      maven-move -> upstream/maven-move

            * [new branch]      one-offs   -> upstream/one-offs

            * [new branch]      stomp_1_1  -> upstream/stomp_1_1

            You asked to pull from the remote 'upstream', but did not specify

            a branch. Because this is not the default configured remote

            for your current branch, you must specify a branch on the command line.

             

             

             

            After this my copy became a bit weird.

            • 3. Re: git-help me please?
              borges Novice

              As git tells you in the end of its output:

              You asked to pull from the remote 'upstream', but did not specify

              a branch. Because this is not the default configured remote

              for your current branch, you must specify a branch on the command line.

               

              Given that you do not want upstream as your default remote (since then you would be pushing into it). It seems obvious that you should be just specifying the branch:

               

              git pull --rebase upstream master

              • 4. Re: git-help me please?
                Clebert Suconic Master

                Why is it duplicating the branches... it shouldn't damage my clone. That's the weird part.

                • 5. Re: git-help me please?
                  Clebert Suconic Master

                  this is really weird..

                   

                   

                  all I wanted was to get a list of new branches from upstream, so I just did a simple git fetch and it again caused the duplicates:

                   

                  git fetch upstream

                   

                  From git://github.com/hornetq/hornetq

                  * [new branch]      20-optimisation -> upstream/20-optimisation

                  * [new branch]      2_2_0_HA_Improvements -> upstream/2_2_0_HA_Improvements

                  * [new branch]      2_2_0_HA_Improvements_preMerge -> upstream/2_2_0_HA_Improvements_preMerge

                  * [new branch]      Branch_2_1 -> upstream/Branch_2_1

                  * [new branch]      Branch_2_1_inactive_dont_use -> upstream/Branch_2_1_inactive_dont_use

                  * [new branch]      Branch_2_2_2_REST -> upstream/Branch_2_2_2_REST

                  * [new branch]      Branch_2_2_2_REST@10429 -> upstream/Branch_2_2_2_REST@10429

                  * [new branch]      Branch_2_2_2_REST@10431 -> upstream/Branch_2_2_2_REST@10431

                  * [new branch]      Branch_2_2_2_REST@10432 -> upstream/Branch_2_2_2_REST@10432

                  * [new branch]      Branch_2_2_2_REST@10600 -> upstream/Branch_2_2_2_REST@10600

                  * [new branch]      Branch_2_2_AS7 -> upstream/Branch_2_2_AS7

                  * [new branch]      Branch_2_2_EAP -> upstream/Branch_2_2_EAP

                  • 6. Re: git-help me please?
                    Clebert Suconic Master

                    So, all you have to do to replicate this:

                     

                    git clone git@github.com:clebertsuconic/hornetq.git

                     

                    git fetch upstream

                    From git://github.com/hornetq/hornetq

                     

                    * [new branch]      20-optimisation -> upstream/20-optimisation

                     

                    * [new branch]      2_2_0_HA_Improvements -> upstream/2_2_0_HA_Improvements

                    * [new branch]      2_2_0_HA_Improvements_preMerge -> upstream/2_2_0_HA_Improvements_preMerge

                    * [new branch]      Branch_2_1 -> upstream/Branch_2_1

                    * [new branch]      Branch_2_1_inactive_dont_use -> upstream/Branch_2_1_inactive_dont_use

                    * [new branch]      Branch_2_2_2_REST -> upstream/Branch_2_2_2_REST

                    * [new branch]      Branch_2_2_2_REST@10429 -> upstream/Branch_2_2_2_REST@10429

                    * [new branch]      Branch_2_2_2_REST@10431 -> upstream/Branch_2_2_2_REST@10431

                    * [new branch]      Branch_2_2_2_REST@10432 -> upstream/Branch_2_2_2_REST@10432

                    * [new branch]      Branch_2_2_2_REST@10600 -> upstream/Branch_2_2_2_REST@10600

                    * [new branch]      Branch_2_2_AS7 -> upstream/Branch_2_2_AS7

                    * [new branch]      Branch_2_2_EAP -> upstream/Branch_2_2_EAP

                    * [new branch]      Branch_2_2_EAP-cluster-cleanup -> upstream/Branch_2_2_EAP-cluster-cleanup

                    * [new branch]      Branch_2_2_EAP_HORNETQ-685 -> upstream/Branch_2_2_EAP_HORNETQ-685

                    * [new branch]      Branch_2_2_EAP_HORNETQ-787 -> upstream/Branch_2_2_EAP_HORNETQ-787

                    * [new branch]      Branch_2_2_EAP_cluster4 -> upstream/Branch_2_2_EAP_cluster4

                    * [new branch]      Branch_2_2_EAP_cluster_clean2 -> upstream/Branch_2_2_EAP_cluster_clean2

                    * [new branch]      Branch_2_2_EAP_cluster_clean3 -> upstream/Branch_2_2_EAP_cluster_clean3

                    * [new branch]      Branch_2_2_EAP_export_tool -> upstream/Branch_2_2_EAP_export_tool

                    * [new branch]      Branch_2_2_EAP_hq782 -> upstream/Branch_2_2_EAP_hq782

                    * [new branch]      Branch_Large_Message_Compression -> upstream/Branch_Large_Message_Compression

                    * [new branch]      Branch_New_Paging -> upstream/Branch_New_Paging

                    * [new branch]      Branch_New_Paging_preMerge -> upstream/Branch_New_Paging_preMerge

                    * [new branch]      Branch_Replication_Changes -> upstream/Branch_Replication_Changes

                    * [new branch]      ClebertCallback -> upstream/ClebertCallback

                    * [new branch]      ClebertTemporary -> upstream/ClebertTemporary

                    * [new branch]      Clebert_Sync -> upstream/Clebert_Sync

                    * [new branch]      Clebert_TMP -> upstream/Clebert_TMP

                    * [new branch]      HORNETQ-129_STOMP_protocol -> upstream/HORNETQ-129_STOMP_protocol

                    * [new branch]      HORNETQ-316 -> upstream/HORNETQ-316

                    * [new branch]      HORNETQ-316_for-r11196 -> upstream/HORNETQ-316_for-r11196

                    * [new branch]      HORNETQ-316_for_2_2_EAP -> upstream/HORNETQ-316_for_2_2_EAP

                    * [new branch]      HORNETQ-316_old -> upstream/HORNETQ-316_old

                    * [new branch]      HORNETQ-515 -> upstream/HORNETQ-515

                    * [new branch]      HORNETQ-681 -> upstream/HORNETQ-681

                    * [new branch]      HORNETQ-720_Replication -> upstream/HORNETQ-720_Replication

                    * [new branch]      HORNETQ_650 -> upstream/HORNETQ_650

                    * [new branch]      HnetQ_323_cn -> upstream/HnetQ_323_cn

                    * [new branch]      Hornet_194 -> upstream/Hornet_194

                    * [new branch]      Hornet_194_Replication_reinit_old -> upstream/Hornet_194_Replication_reinit_old

                    * [new branch]      NEW_PAGING -> upstream/NEW_PAGING

                    * [new branch]      Replication_Clebert -> upstream/Replication_Clebert

                    * [new branch]      STOMP11    -> upstream/STOMP11

                    * [new branch]      STOMP11_PERF -> upstream/STOMP11_PERF

                    * [new branch]      hornetq-416 -> upstream/hornetq-416

                    * [new branch]      hornetq_grouping -> upstream/hornetq_grouping

                    * [new branch]      i18n_logging -> upstream/i18n_logging

                    * [new branch]      master     -> upstream/master

                    * [new branch]      maven-move -> upstream/maven-move

                    * [new branch]      one-offs   -> upstream/one-offs

                    * [new branch]      stomp_1_1  -> upstream/stomp_1_1

                     

                     

                     

                    git checkout i18n_logging

                     

                    error: pathspec 'i18n_logging' did not match any file(s) known to git.

                    • 7. Re: git-help me please?
                      Yong Hao Gao Master

                      Not sure what's going on. I usually do

                       

                      git branch -r

                       

                      to list the remote branches, and after that I checkout the branch I need, like:

                       

                      git checkout -b eap22 origin/Branch_2_2_EAP

                      • 8. Re: git-help me please?
                        Andy Taylor Master

                        Clebert,

                         

                        they arent duplicate branches when you upstream/master for instance is headless and there just to track changes wher as master is your local branch of it. So when you fetch it fetches too upstream/.... and when you pull it pulls the commits from upstream/.. into your local branch.