Both sides previous revisionPrevious revisionNext revision | Previous revisionLast revisionBoth sides next revision |
evergreen-docs:github-workflow [2023/12/28 15:18] – aneiman | evergreen-docs:github-workflow [2023/12/28 15:51] – aneiman |
---|
- If more than one: ''%%git cherry-pick -s [BRANCHNAME]~[Number of commits]..[BRANCHNAME] --edit%%'' (for example, if you are bringing in two commits from the survey-docs branch, run ''%%git cherry-pick survey-docs~2..survey-docs) --edit%%'' | - If more than one: ''%%git cherry-pick -s [BRANCHNAME]~[Number of commits]..[BRANCHNAME] --edit%%'' (for example, if you are bringing in two commits from the survey-docs branch, run ''%%git cherry-pick survey-docs~2..survey-docs) --edit%%'' |
- The ''%%--edit%%'' flag will permit you to edit all commit messages as they come in. | - The ''%%--edit%%'' flag will permit you to edit all commit messages as they come in. |
- To squash commits: | - If you need to squash commits: |
- - Verify that you are in your local branch. | - From your local branch, enter ''git rebase -i HEAD~2'' (where 2 is the number of commits you wish to combine) |
- Type: ''git rebase -i origin/main'' | - Your text editor will open and should show both of the commits, for example: |
* Alternatively if your branch is already built on current main, you can use: ''git rebase -i HEAD~4'' (where 4 is the number of commits you wish to combine) | - pick [COMMIT HASH 1] [COMMIT MESSAGE 1] |
- Your text editor will open and should show both of the commits, for example: | - pick [COMMIT HASH 2] [COMMIT MESSAGE 2] |
* pick 014e59c579 LP#1839359 Select element on login not accessible | - Change the word "pick" in the second line to "fixup" then save and close the file |
* pick 9de92lsi9a LP#1839359 Select element on login not accessible | - squash --> merges commits, then allows amendment of commit message |
- Change the word "pick" in the second line to "fixup" then save and close the file | - fixup --> merges commits like squash does, but discards previous commit message |
* squash --> merges commits, then allows amendment of commit message | - Check gitlog to ensure that you now have a single commit |
* fixup --> merges commits like squash does, but discards previous commit message | |
- Push the commit again, and force it to overwrite the previous commits: | |
* ''git push <nowiki>--force</nowiki> working lp1839359_login_select:user/jdoe/lp1839359_login_select'' | |
- Make any corrections (via additional commits, if needed) | - Make any corrections (via additional commits, if needed) |
- Use ''git log'' to make sure everything looks good. | - Use ''git log'' to make sure everything looks good. |