1"use strict";(self.webpackChunklearn_git=self.webpackChunklearn_git||[]).push([[461],{22462:function(e,t,n){n.r(t),n.d(t,{Head:function(){return O},default:function(){return I}});var a=n(98587),l=n(21585),s=n.n(l),r=n(58156),i=n.n(r),o=n(62193),c=n.n(o),m=n(28453),d=n(96540);function u(e){const t=Object.assign({p:"p",a:"a",h2:"h2",h3:"h3",pre:"pre",code:"code",em:"em"},(0,m.RP)(),e.components),n=t.InfoBlock,a=t.GitTooltip,l=t.WarningBlock;return a||E("GitTooltip",!0),n||E("InfoBlock",!0),l||E("WarningBlock",!0),d.createElement(d.Fragment,null,d.createElement(t.p,null,"Changing the order of commits can present a more readable history. Reordering is also useful for sequencing related changes."),"\n",d.createElement(n,null,d.createElement(t.p,null,"Reorder is not a standalone Git command, it's one of many commands available under ",d.createElement(a,{term:"interactive-rebase"},"interactive rebase"),". Learning interactive rebase is a key stepping stone to understanding the reword workflow. ",d.createElement(t.a,{href:"/lessons/interactive-rebase"},"Learn about interactive rebase."))),"\n",d.createElement(t.h2,{id:"the-workflow"},"The Workflow"),"\n",d.createElement(t.h3,{id:"1-select-commits-to-manipulate"},"1. Select commits to manipulate"),"\n",d.createElement(t.p,null,"Start by telling Git which commits to manipulate by specifying a sequence of commits starting at the ",d.createElement(a,{term:"head"},"HEAD")," pointer and working backwards:"),"\n",d.createElement(t.pre,null,d.createElement(t.code,{className:"language-shell"},"git rebase -i HEAD~2\n")),"\n",d.createElement(t.h3,{id:"2-create-the-instruction-set"},"2. Create the instruction set"),"\n",d.createElement(t.p,null,"After executing the rebase command, Git will open your default terminal text editor (most likely Vim) and present a default set of instructions. Commits from the selected sequence are listed at the top of this file:"),"\n",d.createElement(t.pre,null,d.createElement(t.code,{className:"language-shell"},"pick 7f9d4bf Updated README\npick 3f8e810 Accessibility fix\n\n# Rebase 4095f73..ec48d74 onto 4095f73 (3 commands)\n#\n# Commands:\n# p, pick <commit> = use commit\n# r, reword <commit> = use commit, but edit the commit message\n...\n")),"\n",d.createElement(t.p,null,"To reorder, simply change the order of the commits in the instruction set. If you're using Vim, type ",d.createElement(t.em,null,"i")," to enter insert mode and make the changes."),"\n",d.createElement(t.pre,null,d.createElement(t.code,{className:"language-shell"},"pick 3f8e810 Accessibility fix\npick 7f9d4bf Updated README\n")),"\n",d.createElement(l,null,d.createElement(t.p,null,"Be careful when performing this step. Accidentally deleting a commit line will cause Git to destroy the commit.")),"\n",d.createElement(t.h3,{id:"3-execute-the-instruction-set"},"3. Execute the instruction set"),"\n",d.createElement(t.p,null,"Once reordering is complete, save and quit the file (again, in Vim, press ",d.createElement(t.em,null,"ESC")," then type ",d.createElement(t.em,null,":wq")," to save and exit). Git will then replay history by stepping through this file one row at a time, applying changes using the ordering specified."))}var p=function(e){void 0===e&&(e={});const t=Object.assign({},(0,m.RP)(),e.components).wrapper;return t?d.createElement(t,e,d.createElement(u,e)):u(e)};function E(e,t){throw new Error("Expected "+(t?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}var g=n(24794),h=n(3529),f=n(74423),v=n(2125),b=n(4907),y=n(23191),w=n(54755),k=n(79479),x=n(66452),N=n(18726),A=n(82358),L=n(64238),T=n(69478),_=n(8762),C=n(16304),q=n(39796),z=n(18565);const B=["data","children"];function R(e){let t=e.data,n=e.children;(0,a.A)(e,B);const l=(0,f.As)(),s=l.user,r=l.isLoading,o=i()(t,"contentfulLesson"),m=i()(o,"quiz"),u=i()(o,"exercise"),p=i()(o,"body.body"),E=i()(o,"module[0]"),g=i()(E,"course[0]"),v=i()(E,"draft",!0),y=i()(o,"video"),C=i()(y,"vid")?atob(y.vid):null,R=i()(o,"visualizations"),O=!!y&&!v,I=!c()(R),P=_.M.filter((e=>"read"===e.id||"watch"===e.id&&O||"explore"===e.id&&I)),G=(0,d.useState)(O?"w
1atch":P[0].id),M=G[0],W=G[1],j="watch"===M&&O,H="explore"===M&&I,D=!j&&!H,Q=(0,d.useState)({[O?"watch":P[0].id]:!0,read:!0}),U=Q[0],V=Q[1],Z=(0,z.y)(i()(E,"id"),i()(g,"modules")),$=Z.next_module,J=Z.previous_module,Y=(0,z.u)(o.id,i()(E,"lessons"),$,J),K=Y.next_lesson,X=Y.previous_lesson,ee=!!K&&i()($,"lessons[0].id")===K.id,te=i()(ee?$:E,"plans")||[],ne=!r&&!(0,f.w)(te,s);return d.createElement(h.A,{currentPageObject:o,plansWithAccessByUid:i()(E,"plans")||[],contentMaxWidth:m&&!y?840:void 0},d.createElement("header",{style:{marginBottom:"var(--s-6)"}},E&&E.title&&d.createElement("div",{className:"eyebrow",style:{color:"var(--brand-deep)"}},E.title),d.createElement("div",{className:"ds-cluster ds-cluster--between ds-cluster--wrap ds-gap-4",style:{marginTop:"var(--s-2)"}},d.createElement("div",{className:"ds-cluster ds-gap-3"},d.createElement("h1",{className:"h1"},o.title),u&&d.createElement(q.m_,{placement:"bottom"},d.createElement(q.k$,null,d.createElement("span",{className:"stat-pill stat-pill--reward",style:{cursor:"help",textTransform:"uppercase",letterSpacing:"0.5px"}},"Beta")),d.createElement(q.ZI,null,"Please report issues using the thumbs up/down icons below."))),d.createElement("div",{className:"ds-cluster ds-gap-3"},d.createElement(b.A,{slug:i()(o,"slug",""),readOnly:!(!m&&!u),readOnlyHint:u?"Complete all goals to mark complete":void 0,variant:"header"}),d.createElement(S,{slug:i()(o,"slug",""),next_lesson:K,locked:ne}))),m&&!y&&d.createElement("p",{className:"lead",style:{marginTop:"var(--s-3)"}},"Test your knowledge!"),u&&!y&&d.createElement("p",{className:"lead",style:{marginTop:"var(--s-3)"}},"Your turn â type commands to complete the exercise.")),u?d.createElement(d.Fragment,null,d.createElement(T.A,{exercise:u,lessonSlug:i()(o,"slug","")}),!v&&p?d.createElement("div",{className:"content",style:{marginTop:"var(--s-8)"}},n):null):d.createElement(d.Fragment,null,P.length>1?d.createElement("div",{className:"lesson-mode-switcher",style:{marginBottom:"var(--s-6)"}},d.createElement(_.A,{tabs:P,active:M,onChange:e=>{V((t=>t[e]?t:Object.assign({},t,{[e]:!0}))),W(e)}})):d.createElement(d.Fragment),O&&(U.watch||j)?d.createElement("div",{className:"lesson-video-header",style:{display:j?void 0:"none"}},"vimeo"===y.hostingPlatform?d.createElement(w.A,{videoId:C,borderRadius:"8px",shadow:!0}):d.createElement(A.A,{videoId:C,borderRadius:"8px",shadow:!0})):d.createElement(d.Fragment),I&&(U.explore||H)?d.createElement("div",{style:{display:H?void 0:"none"}},d.createElement(L.A,{visualizations:R})):d.createElement(d.Fragment),U.read||D?d.createElement("div",{style:{display:D?void 0:"none"}},d.createElement(k.A,{content:p}),d.createElement("div",{className:"content"},v?d.createElement("p",null,d.createElement("strong",null,"Lesson not found."),d.createElement("br"),"If you suspect this to be in error, please submit a help request."):n,m?d.createElement(d.Fragment,null,d.createElement(x.A,{title:"Quiz",questions:m.questionsJson.questions,lessonSlug:i()(o,"slug","")})):d.createElement(d.Fragment))):d.createElement(d.Fragment)),d.createElement("div",{style:{marginTop:"var(--s-8)",marginBottom:"var(--s-4)"}},d.createElement(b.A,{slug:i()(o,"slug",""),readOnly:!(!m&&!u),readOnlyHint:u?"Complete all goals to mark complete":void 0})),d.createElement(F,{previous_lesson:X,next_lesson:K,nextLocked:ne}),d.createElement("div",{className:"ds-cluster ds-cluster--center ds-gap-3",style:{marginTop:"var(--s-9)",color:"var(--muted)",fontSize:"var(--fs-small)"}},d.createElement("span",null,"Was this lesson helpful?"),d.createElement(N.A)))}const S=e=>{let t=e.slug,n=e.next_lesson,a=e.locked,l=void 0!==a&&a;const r=(0,y.p)(),o=r.data,c=r.isPending,m=i()(n,"fields.path"),u=s()(o,t)>=0,p=(0,d.useState)(!1),E=p[0],h=p[1],f=(0,d.useRef)({slug:null,complete:null});if((0,d.useEffect)((()=>{if(c)return;const e=f.current;f.current={slug:t,complete:u},e.slug===t&&!1===e.complete&&u&&h(!0)}),[t,u,c]),!m||!u)return null;const v=d.createElement(g.Link,{to:m,className:"btn btn-primary btn-sm btn-nudge lesson-next"+(E?" lesson-next--enter":""),"aria-label":"Next lesson: "+n.title,onAnimationEnd:()=>h(!1)},l?d.createElement(C.LM,{size:12}):null,d.createElement("span",null,"Next"),d.createElement(C.Qp,{size:16}));return l?d.createElement(q.m_,null,d.createElement(q.k$,{asChild:!0},v),d.createElement(q.ZI,{className:"Tooltip"},"The next module is part of a paid plan")):v},F=e=>{let t=e.previous_lesson,n=e.next_lesson,a=e.nextLocked,l=void 0!==a&&a;const s=i()(t,"fields.path"),r=i()(n,"fields.path"),o=t&&s,c=n&&r;return o||c?d.createElement("nav",{className:"lesson-pager","aria-label":"Lesson navigation"},o?d.createElement(g.Link,{to:s,className:"lesson-pager-btn lift"},d.createElement("span",{className:"eyebrow lesson-pager-dir"},d.createElement(C.nk,{size:14})," Previous"),d.createElement("span",{className:"lesson-pager-title"},t.title)):d.createElement("span",{className:"lesson-pager-spacer"}),c?d.createElement(g.Link,{to:r,className:"lesson-pager-btn lesson-pager-btn--next lift"},d.createElement("span",{className:"eyebrow lesson-pager-dir"},"Next ",l&&d.createElement("span",{className:"lesson-pager-lock"},d.createElement(C.LM,{size:12})," Paid")," ",d.createElement(C.Qp,{size:14})),d.createElement("span",{className:"lesson-pager-title"},n.title)):d.createElement("span",{className:"lesson-pager-spacer"})):null},O=e=>{let t=e.data;return d.createElement(v.A,{title:i()(t,"contentfulLesson.title")})};function I(e){return d.createElement(R,e,d.createElement(p,e))}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.