newdevs:git:commands
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionLast revisionBoth sides next revision | ||
newdevs:git:commands [2023/01/13 10:07] – [Git Commands] tmccanna | newdevs:git:commands [2024/03/25 16:32] – [Squash Commits] tmccanna | ||
---|---|---|---|
Line 1: | Line 1: | ||
**New Developers Working Group** | **New Developers Working Group** | ||
- | ====== Git for Windows ====== | + | ====== |
- | + | ||
- | ===== Useful | + | |
- | + | ||
- | ==== Git Commands | + | |
* '' | * '' | ||
Line 15: | Line 11: | ||
* '' | * '' | ||
* '' | * '' | ||
- | * '' | + | * '' |
- | * '' | + | * '' |
* '' | * '' | ||
* '' | * '' | ||
Line 22: | Line 18: | ||
* '' | * '' | ||
* '' | * '' | ||
+ | * '' | ||
* '' | * '' | ||
* '' | * '' | ||
* '' | * '' | ||
* '' | * '' | ||
+ | * '' | ||
* '' | * '' | ||
* '' | * '' | ||
Line 31: | Line 29: | ||
* '' | * '' | ||
* '' | * '' | ||
+ | * '' | ||
+ | * '' | ||
* '' | * '' | ||
+ | * '' | ||
* '' | * '' | ||
* '' | * '' | ||
* '' | * '' | ||
- | * '' | + | * '' |
- | * '' | + | * '' |
- | * '' | + | * '' |
* '' | * '' | ||
* '' | * '' | ||
* '' | * '' | ||
* '' | * '' | ||
+ | * '' | ||
* '' | * '' | ||
* '' | * '' | ||
* '' | * '' | ||
* | * | ||
- | * '' | + | * '' |
+ | * '' | ||
* '' | * '' | ||
* '' | * '' | ||
Line 56: | Line 59: | ||
==== Rebase ==== | ==== Rebase ==== | ||
- | If your patch is behind current | + | If your patch is behind current |
- Open the git branch | - Open the git branch | ||
- | - Type: git rebase origin/master | + | - Type: git rebase origin/main --> rebases the current branch to main (you can do this when you have your branch checked out and changes committed, but have not yet pushed it) |
- If there are merge conflict errors, type: git status | - If there are merge conflict errors, type: git status | ||
- Open the file with the problem in your preferred text editor (notepad++, vim, nano, etc.) | - Open the file with the problem in your preferred text editor (notepad++, vim, nano, etc.) | ||
Line 70: | Line 73: | ||
==== Squash Commits ==== | ==== Squash Commits ==== | ||
- | If you are in your local working | + | If you have multiple commits |
- | - Verify | + | - Use 'git log' to verify |
- | - Type: '' | + | - Type '' |
- | * Alternatively if your branch is already built on current master, you can use: '' | + | |
- Your text editor will open and should show both of the commits, for example: | - Your text editor will open and should show both of the commits, for example: | ||
* pick 014e59c579 LP#1839359 Select element on login not accessible | * pick 014e59c579 LP#1839359 Select element on login not accessible | ||
* pick 9de92lsi9a LP#1839359 Select element on login not accessible | * pick 9de92lsi9a LP#1839359 Select element on login not accessible | ||
- | - Change the word " | + | - Change the word " |
* squash --> merges commits, then allows amendment of commit message | * squash --> merges commits, then allows amendment of commit message | ||
* fixup --> merges commits like squash does, but discards previous commit message | * fixup --> merges commits like squash does, but discards previous commit message | ||
- | - Push the commit | + | - Use " |
- | * '' | + | - Push the changes up to your remote working directory as normal |
+ | * '' | ||
+ | |||
+ | If you've already pushed multiple | ||
+ | |||
+ | - Follow the steps above, but when pushing, use " | ||
+ | * '' | ||
newdevs/git/commands.txt · Last modified: 2024/03/25 16:35 by tmccanna