2016-07-15 3 views
0

Ich habe eine Situation, wo meine Zweige wie folgt aussehen:Git: Wie wiederhole ich Commits, die in einem anderen Zweig erscheinen?

* d3b91f2 (HEAD, origin/narrowdown_lblrtmprogram, narrowdown_lblrtmprogram, lowercase_main_src_code) resolve gi 
t-pull conflict. gitignore *.mod and *.so 
|\ 
| * 0ed828f number all the markers which a typical run goes past 
| * 7a9fd6a gitignore *.o and lblrtm executables 
| * 40e824a stop tracking lblrtm/lblrtm_v12.2_linux_intel_dbl 
| * cfb6866 stop tracking some previously tracked files but are now in .gitignore 
| * 314451c lay down markers in main program 
| * a0d6edf gitignore *.mod 
| * 5e9352a gitignore `runs/` directory 
* | 2e48384 number all the markers which a typical run goes past 
* | a0db0ed gitignore *.o and lblrtm executables 
* | df52ddc stop tracking some previously tracked files but are now in .gitignore 
* | 37fc6d1 lay down markers in main program 
* | 9deee6a gitignore *.mod 
* | 9ae357a (origin/trace_lblrtm_lw_flux_calc, trace_lblrtm_lw_flux_calc) gitignore runs/ 
* | 4ce55a0 gitignore *.o and lblrtm executables 
* | 3691140 stop tracking lblrtm/lblrtm_v12.2_linux_intel_dbl 
|/ 
| * 3c8edd0 (origin/master, master) gitignore runs/ 
| * 969a8e1 gitignore *.o and lblrtm executables 
|/ 
* 11ed99d Revert "Add write() statements to mark path through lblrtm source code for example solar run" 

Es scheint zwei Zweige zu sein, die an der obersten d3b91f2 begehen zusammengeführt werden. Die Zugaben von 3691140 bis 2e48384 sind jedoch effektiv dieselben wie diejenigen von 5e9352a bis 0ed828f. Gibt es eine Möglichkeit, diese redundanten Commits von 5e9352a zu 0ed828f loszuwerden? Da

Blick auf
[[email protected] aerlbl_v12.2_package]$ git log -10 narrowdown_lblrtmprogram --oneline 
d3b91f2 resolve git-pull conflict. gitignore *.mod and *.so 
2e48384 number all the markers which a typical run goes past 
a0db0ed gitignore *.o and lblrtm executables 
df52ddc stop tracking some previously tracked files but are now in .gitignore 
37fc6d1 lay down markers in main program 
9deee6a gitignore *.mod 
9ae357a gitignore runs/ 
4ce55a0 gitignore *.o and lblrtm executables 
3691140 stop tracking lblrtm/lblrtm_v12.2_linux_intel_dbl 
0ed828f number all the markers which a typical run goes past 

und

[[email protected] aerlbl_v12.2_package]$ git log -10 --oneline lowercase_main_src_code 
d3b91f2 resolve git-pull conflict. gitignore *.mod and *.so 
2e48384 number all the markers which a typical run goes past 
a0db0ed gitignore *.o and lblrtm executables 
df52ddc stop tracking some previously tracked files but are now in .gitignore 
37fc6d1 lay down markers in main program 
9deee6a gitignore *.mod 
9ae357a gitignore runs/ 
4ce55a0 gitignore *.o and lblrtm executables 
3691140 stop tracking lblrtm/lblrtm_v12.2_linux_intel_dbl 
0ed828f number all the markers which a typical run goes past 

diese Commits scheinen nicht lowercase_main_src_code, entweder Zweig narrowdown_lblrtmprogram oder Zweig zu gehören, so kann ich nicht git branch -d verwenden.

Antwort

1

interaktive Rebase kann hilfreich sein.

git rebase -i 11ed99d 

und Flagge verpflichtet Sie mit d Marker löschen möchten.

Stellen Sie sicher, dass Sie einen Backup-Zweig haben, oder Sie müssen einen git reflog tun, wenn etwas fehlschlägt.

+0

Danke, das funktioniert! Obwohl ich später erkannte, dass die wiederholten Commits tatsächlich auf dem gleichen Zweig sind, unter Berücksichtigung dessen, sollte meine Frage "wie man eine Reihe von Commits in der Commit-Geschichte löschen", die bereits hier http: // stackoverflow gefragt wurde. com/questions/1338728/delete-commits-from-a-branch-in-git. – Jack

Verwandte Themen