mbien commented on PR #6797:
URL: https://github.com/apache/netbeans/pull/6797#issuecomment-1848666984

   I assume you fixed the global git config already, you can check with `git 
config --list --global`
   
   here is how I would do it:
   
   lets put your commits on top of latest master (this changes the history in 
your branch, but we have to do this anyway):
   
   check out your branch locally (you likely already have that)
   run: 
   ```
   $ git pull --rebase --autostash [email protected]:apache/netbeans master
   From github.com:apache/netbeans
    * branch                master     -> FETCH_HEAD
   Current branch hudsontojenkins is up to date.
   ```
   this rebases your commits on latest master
   check with:
   ```
   $ git log --oneline
   bd3116056 (HEAD -> hudsontojenkins) Renamed Hudson to Jenkins
   cb4ff7ed2 Fixed the Issue of Renaming Hudson to Jenkins without changing any 
directory or method names
   b6a064d59 (origin/master, origin/HEAD, master) Use Ant for building NetBeans 
Gradle Tooling
   775f0f0ea Merge pull request #6765 from mbien/maven-dep-hint-profiles
   1b075fe0c Merge pull request #6748 from 
matthiasblaesing/jpa_provider_on_classpath
   ...
   ```
   so you see that your 2 commits are indeed on top of all other commits.
   
   now lets squash the 2 commits:
   ```
   $ git rebase --autostash -i HEAD~2
   ```
   
   this will open an editor with instructions. For this use case here, you have 
to change "pick" into "s" on all commits except the commit in the first line 
(so only the second line basically). This will squash the second commit into 
the first and then ask you to update the commit message, which you should do.
   
   lets check again:
   ```
   $ git log --oneline
   be2399296 (HEAD -> hudsontojenkins) Fixed the Issue of Renaming Hudson to 
Jenkins without changing any directory or method names
   b6a064d59 (origin/master, origin/HEAD, master) Use Ant for building NetBeans 
Gradle Tooling
   775f0f0ea Merge pull request #6765 from mbien/maven-dep-hint-profiles
   1b075fe0c Merge pull request #6748 from 
matthiasblaesing/jpa_provider_on_classpath
   ```
   worked!
   
   Now lets fix the commit header, since it would still have the wrong name:
   ```
   $ git log --oneline -n1 --pretty=format:'%h %an [%ae] %s'
   be2399296 rothardo [[email protected]] Fixed the Issue of Renaming 
Hudson to Jenkins without changing any directory or method names
   ```
   ```
   $ git commit --amend --author="Your Name <[email protected]>"
   ```
   check with `git log` and everything should be fine now
   
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists

Reply via email to