2009-11-13 9 views
6

मैं कई लोगों को एक साथ जोड़ना चाहता हूं।रीट कई गिट में एक के लिए प्रतिबद्ध है। मैं क्या गलत कर रहा हूं?

# Go back to the last commit that we want to form the initial commit (detach HEAD) 
git checkout <sha1_for_B> 

# reset the branch pointer to the initial commit, 
# but leaving the index and working tree intact. 
git reset --soft <sha1_for_A> 

# amend the initial tree using the tree from 'B' 
git commit --amend 

# temporarily tag this new initial commit 
# (or you could remember the new commit sha1 manually) 
git tag tmp 

# go back to the original branch (assume master for this example) 
git checkout master 

# Replay all the commits after B onto the new initial commit 
git rebase --onto tmp <sha1_for_B> 

# remove the temporary tag 
git tag -d tmp 

मुझे लगता है कि इसके बाद के संस्करण कोड ब्लॉक में बी सबसे पुराने प्रतिबद्ध है: मैं विधि पिछले एक StackOverflow answer में वर्णित है जो कहता पालन किया है।

यहाँ मुझे क्या होता है:

$ cd rebase-test 
$ git branch 
    gui 
* master 
$ git log --pretty=oneline 
7391d1b8e51b766190794ede49e3338307a64225 Merge branch 'gui' 
c69d44b0d3615d4f537ca42fe67ee58e2728a31a Work in progress. Next port transform() 
e710a839c5aee0b07178da1f97999fa6dba445d6 audio_load() implemeted in callback.c 
... 
$ git checkout c69d44b0d3615d4f537ca42fe67ee58e2728a31a 
Note: moving to 'c69d44b0d3615d4f537ca42fe67ee58e2728a31a' which isn't a local branch 
If you want to create a new branch from this checkout, you may do so 
(now or later) by using -b with the checkout command again. Example: 
    git checkout -b <new_branch_name> 
HEAD is now at c69d44b... Work in progress. Next port transform() 
$ git reset --soft 7391d1b8e51b766190794ede49e3338307a64225 
$ git commit --amend 
[detached HEAD ad4e92a] new 
$ git tag tmp 
$ git checkout gui 
Previous HEAD position was ad4e92a... new 
Switched to branch 'gui' 
$ git rebase --onto tmp c69d44b0d3615d4f537ca42fe67ee58e2728a31a 
First, rewinding head to replay your work on top of it... 
Applying: Removed build files 
Applying: Removed more build files 
Applying: Fixed infile_handler crash 
/home/louise/rebase-test/.git/rebase-apply/patch:90: space before tab in indent. 
     for(int j = 0; j < data->audio_info_load->channels; j++) { 
/home/louise/rebase-test/.git/rebase-apply/patch:91: space before tab in indent. 
      if(j == selected_channel) { 
/home/louise/rebase-test/.git/rebase-apply/patch:92: space before tab in indent. 
      data->mono_channel[while_counter * const_frames_read + i] = bufferIn[i * data->audio_info_load->channels + selected_channel]; 
/home/louise/rebase-test/.git/rebase-apply/patch:93: space before tab in indent. 
      } 
/home/louise/rebase-test/.git/rebase-apply/patch:94: space before tab in indent. 
     } 
warning: 5 lines add whitespace errors. 
Applying: sf_readf_double() crashes 
Applying: Crash fixed 
Applying: Created audio_load() 
/home/louise/rebase-test/.git/rebase-apply/patch:73: space before tab in indent. 
     for(int j = 0; j < data->audio_info_load->channels; j++) { 
/home/louise/rebase-test/.git/rebase-apply/patch:74: space before tab in indent. 
      if(j == selected_channel) { 
/home/louise/rebase-test/.git/rebase-apply/patch:75: space before tab in indent. 
      data->mono_channel[while_counter * const_frames_read + i] = bufferIn[i * data->audio_info_load->channels + selected_channel]; 
/home/louise/rebase-test/.git/rebase-apply/patch:76: space before tab in indent. 
      } 
/home/louise/rebase-test/.git/rebase-apply/patch:77: space before tab in indent. 
     } 
warning: 5 lines add whitespace errors. 
Applying: Clean up 
/home/louise/rebase-test/.git/rebase-apply/patch:58: trailing whitespace. 

/home/louise/rebase-test/.git/rebase-apply/patch:60: trailing whitespace. 

/home/louise/rebase-test/.git/rebase-apply/patch:67: trailing whitespace. 

/home/louise/rebase-test/.git/rebase-apply/patch:72: trailing whitespace. 

/home/louise/rebase-test/.git/rebase-apply/patch:80: trailing whitespace. 

warning: squelched 11 whitespace errors 
warning: 16 lines add whitespace errors. 
Applying: transform_inv() implemented 
/home/louise/rebase-test/.git/rebase-apply/patch:115: trailing whitespace. 
    free(data->mono_channel); 
warning: 1 line adds whitespace errors. 
Applying: audio_save() crash 
Applying: Crash fixed 
Applying: Backend finally implemented in gui. 
$ git tag -d tmp 
Deleted tag 'tmp' 

मैं एक ही त्रुटि मिलती है, जब मुझे लगता है कि एक सबसे पुराना है।

क्या कोई देख सकता है कि क्या गलत हो रहा है?

हग्स, लुईस

संपादित करें: मैं उत्पादन को अद्यतन किया है, तो यह पता चलता है क्या होता है जब मैं जारी है।

में
A-B-C-D-E 

:

A-BCD-E 

आप बस इस आदेश दे सकते हैं: तो

$ git rebase -i <sha1_for_A> 

और यह संपादित:

+1

त्रुटि? मुझे कोई त्रुटि नहीं दिख रही है ... –

+0

अंतिम आउटपुट गिट में "जो स्थानीय शाखा नहीं है"। मुझे लगता है कि "स्थानीय" का मतलब है "हार्डड्राइव पर"। "गुई" शाखा मेरे हार्डड्राइव पर है, न कि इंटरनेट पर। या आउटपुट का मतलब कुछ और है? – Louise

+0

आपने चरण एक पर रोक दिया है, जो सफलतापूर्वक पूरा हो गया है (HEAD अब ddf5f7a पर है ...), इसलिए बाकी नुस्खा के साथ आगे बढ़ें। –

उत्तर

12

कि आप क्या करना चाहते हैं यह करना है

pick B 
pick C 
pick D 
pick E 

पढ़ने के लिए:

pick B 
squash C 
squash D 
pick E 

कोई संघर्ष नहीं हैं, तो आप कर चुके हैं।

हालांकि, आप बनाने

ABCD-E 

(दूसरे शब्दों में यदि आप शामिल करना चाहते पहले भंडार के संयुक्त में प्रतिबद्ध प्रतिबद्ध) इस उत्तर भूल जाते हैं और पर एक नजर है करना चाहते हैं आपके द्वारा संदर्भित प्रश्न के approved answer

संबंधित मुद्दे