•  


Reordering commits in GitHub Desktop - GitHub Docs
Skip to main content

Reordering commits in GitHub Desktop

You can use GitHub Desktop to reorder commits in your branch's history.

About reordering a commit

Reordering allows you to alter your commit history to provide a more meaningful progression of commits. GitHub Desktop allows you to drag-and-drop commits in your branch's history to reorder them.

Reordering a commit

  1. In GitHub Desktop, click Current Branch .

    Screenshot of the repository bar. A button, labeled "Current Branch" with a downward arrow indicating a dropdown menu, is outlined in orange.

  2. In the list of branches, click the branch with the commits that you want to reorder.

    Screenshot of the "Current Branch" dropdown view. Under "Recent Branches", a branch, named "my-feature", is highlighted with an orange outline.

  3. In the left sidebar, click History .

    Screenshot of the "History" tab in the sidebar. Above a list of commits, the tab button, labeled "History", is highlighted with an orange outline.

  4. Drag the commit that you want to reorder and drop it between two adjoining commits.

    Screenshot of a list of commits in the "History" tab. The cursor hovers over a narrow horizontal line between two commits, with a "one" icon indicating one commit is being moved.

While the application reorders the commits, a Reorder in process dialog indicates the progress of the change.

Error messages when reordering commits

When you reorder commits, you may see one of the following notifications or error messages.

  • A notification states that the requested change to the branch will require a force push to update the remote branch. This is shown when the commits that you reordered were previously pushed to the remote branch. Force pushing alters the commit history of the branch and will affect other collaborators who are working in that branch. Select Begin reorder to start the reorder, and then click Force push origin to push your changes.
  • An error states that the reorder failed because there is a merge commit among the reordered commits.
  • A notification is shown indicating that there are uncommitted changes present on your current branch. Select Stash Changes and Continue to store the changes and proceed, or select Close to dismiss the message and commit the changes. When there are no longer any uncommitted changes, you can reorder your commits.
  • A message states that there are merge conflicts that you must resolve before the application can continue reordering commits on your branch.
    1. Click View conflicts .

      Screenshot of a notification about conflicts. At the end of the message, a link, labeled "View commits", is highlighted with an orange outline.

    2. Resolve any merge conflicts in your preferred way, using a text editor, the command line, or another tool. For more information, see " Addressing merge conflicts ."

    3. When all conflicts are resolved, you can reorder your commits.

Further reading

- "漢字路" 한글한자자동변환 서비스는 교육부 고전문헌국역지원사업의 지원으로 구축되었습니다.
- "漢字路" 한글한자자동변환 서비스는 전통문화연구회 "울산대학교한국어처리연구실 옥철영(IT융합전공)교수팀"에서 개발한 한글한자자동변환기를 바탕하여 지속적으로 공동 연구 개발하고 있는 서비스입니다.
- 현재 고유명사(인명, 지명등)을 비롯한 여러 변환오류가 있으며 이를 해결하고자 많은 연구 개발을 진행하고자 하고 있습니다. 이를 인지하시고 다른 곳에서 인용시 한자 변환 결과를 한번 더 검토하시고 사용해 주시기 바랍니다.
- 변환오류 및 건의,문의사항은 juntong@juntong.or.kr로 메일로 보내주시면 감사하겠습니다. .
Copyright ⓒ 2020 By '전통문화연구회(傳統文化硏究會)' All Rights reserved.
 한국   대만   중국   일본