Last active
January 23, 2024 19:11
-
-
Save stevemar/06ace005f82691435d0b to your computer and use it in GitHub Desktop.
Revisions
-
stevemar revised this gist
May 6, 2020 . No changes.There are no files selected for viewing
-
stevemart renamed this gist
Jul 19, 2018 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
stevemart revised this gist
Mar 31, 2018 . 1 changed file with 5 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -18,19 +18,22 @@ $ curl -s "https://github.ibm.com/api/v3/orgs/developer-journeys/repos?access_to > This will keep the commit history! ``` ## get the repo to be cloned $ git clone git@github.ibm.com:IBMDigital/Procurement-System.git ## rename the origin branch to something else to avoid conflicts $ git remote rename origin destination ## go to github and create an empty repo, add the new repo location $ git remote add origin https://github.com/IBM/procurement-system.git ## optionally check remotes using -v $ git remote -v destination git@github.ibm.com:IBMDigital/Procurement-System.git (fetch) destination git@github.ibm.com:IBMDigital/Procurement-System.git (push) origin https://github.com/IBM/procurement-system.git (fetch) origin https://github.com/IBM/procurement-system.git (push) ## push code up to new remote branch $ git push -u origin master ## note that if using the below command with 2FA, you will need to ## use a personal access token as a password along with your username! ``` --- -
stevemart revised this gist
Feb 3, 2018 . 1 changed file with 4 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -2,12 +2,15 @@ ## Clone all GHE repos This is limited to cloning 100 repos at a time, the second command gets page 2 ``` TOKEN=foo ORG_NAME=developer-journey COMPANY=IBM $ curl -s "https://github.ibm.com/api/v3/orgs/developer-journeys/repos?access_token=TOKEN&per_page=100" | ruby -rubygems -e 'require "json"; JSON.load(STDIN.read).each { |repo| %x[git clone #{repo["ssh_url"]} ]}' $ curl -s "https://github.ibm.com/api/v3/orgs/developer-journeys/repos?access_token=TOKEN&per_page=100&page=2" | ruby -rubygems -e 'require "json"; JSON.load(STDIN.read).each { |repo| %x[git clone #{repo["ssh_url"]} ]}' ``` ## Move a repo from GHE to GH -
stevemart revised this gist
Feb 2, 2018 . 1 changed file with 2 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -25,7 +25,8 @@ destination git@github.ibm.com:IBMDigital/Procurement-System.git (fetch) destination git@github.ibm.com:IBMDigital/Procurement-System.git (push) origin https://github.com/IBM/procurement-system.git (fetch) origin https://github.com/IBM/procurement-system.git (push) ## note that if using the below command with 2FA, you will need to ## use a personal access token as a password along with your username! $ git push -u origin master ``` -
stevemart revised this gist
Feb 2, 2018 . 1 changed file with 2 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -18,13 +18,14 @@ $ curl -s "https://github.ibm.com/api/v3/orgs/developer-journeys/repos?access_to $ git clone git@github.ibm.com:IBMDigital/Procurement-System.git ## rename the origin branch to something else to avoid conflicts $ git remote rename origin destination ## go to github and create an empty repo $ git remote add origin https://github.com/IBM/procurement-system.git $ git remote -v destination git@github.ibm.com:IBMDigital/Procurement-System.git (fetch) destination git@github.ibm.com:IBMDigital/Procurement-System.git (push) origin https://github.com/IBM/procurement-system.git (fetch) origin https://github.com/IBM/procurement-system.git (push) ## note that if using the below command with 2FA, you will need to use a personal access token as a password! $ git push -u origin master ``` -
stevemart revised this gist
Jan 31, 2018 . 1 changed file with 11 additions and 7 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,4 @@ # GitHub Enterprise ## Clone all GHE repos @@ -45,12 +45,6 @@ $ git push -u origin master 1. git cherry-pick --continue 1. git review ## backporting a patch 1. git checkout -b some_branch_name origin/stable/liberty @@ -60,3 +54,13 @@ $ git push -u origin master 1. git cherry-pick --continue 1. modify the commit message 1. git review stable/liberty --- # General Git ## Undo a git commit amend 1. git reflog (to find the number) 1. git reset --soft HEAD@{number} 1. git commit -C HEAD@{number} -
stevemart revised this gist
Jan 31, 2018 . 1 changed file with 0 additions and 4 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,7 +1,5 @@ # Git ## Clone all GHE repos ``` @@ -34,8 +32,6 @@ $ git push -u origin master # Gerrit ## Remote Rebasing 1. Click "Rebase" button in the Gerrit UI under your patch set. -
stevemart revised this gist
Jan 31, 2018 . 2 changed files with 66 additions and 62 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,66 @@ # Git --- ## Clone all GHE repos ``` TOKEN=foo ORG_NAME=developer-journey COMPANY=IBM $ curl -s "https://github.ibm.com/api/v3/orgs/developer-journeys/repos?access_token=TOKEN&per_page=200" | ruby -rubygems -e 'require "json"; JSON.load(STDIN.read).each { |repo| %x[git clone #{repo["ssh_url"]} ]}' ``` ## Move a repo from GHE to GH > This will keep the commit history! ``` $ git clone git@github.ibm.com:IBMDigital/Procurement-System.git ## rename the origin branch to something else to avoid conflicts $ git remote rename origin destination $ git remote add origin https://github.com/IBM/procurement-system.git $ git remote -v destination git@github.ibm.com:IBMDigital/Procurement-System.git (fetch) destination git@github.ibm.com:IBMDigital/Procurement-System.git (push) origin https://github.com/IBM/procurement-system.git (fetch) origin https://github.com/IBM/procurement-system.git (push) ## note that if using the below command with 2FA, you will need to use a personal access token! $ git push -u origin master ``` --- # Gerrit --- ## Remote Rebasing 1. Click "Rebase" button in the Gerrit UI under your patch set. ## Local rebasing 1. git review -d $PARENT_CHANGE_NUMBER 1. git review -x $BROKEN_CHANGE_NUMBER 1. fix the issues 1. git add 1. git cherry-pick --continue 1. git review ## Undo a git commit amend 1. git reflog (to find the number) 1. git reset --soft HEAD@{number} 1. git commit -C HEAD@{number} ## backporting a patch 1. git checkout -b some_branch_name origin/stable/liberty 1. git review -x <patch #> 1. fix errors 1. git add keystone/ 1. git cherry-pick --continue 1. modify the commit message 1. git review stable/liberty This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,62 +0,0 @@ -
stevemart revised this gist
Apr 13, 2016 . 1 changed file with 7 additions and 5 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -23,11 +23,13 @@ Undo a git commit amend backporting a patch ------------------- 1. git checkout -b some_branch_name origin/stable/liberty 2. git review -x <patch #> 3. fix errors 4. git add keystone/ 5. git cherry-pick --continue 6. modify the commit message 7. git review stable/liberty creating a new oslo library --------------------------- -
stevemart revised this gist
Apr 4, 2015 . 1 changed file with 3 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -32,6 +32,9 @@ backporting a patch creating a new oslo library --------------------------- Before starting, create a new repo within your own github account do not set a license or description. The following example uses oslo.io, so io is used throughout this doc. :: cd /tmp -
stevemart revised this gist
Apr 4, 2015 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -32,7 +32,7 @@ backporting a patch creating a new oslo library --------------------------- :: cd /tmp mkdir graduation -
stevemart revised this gist
Apr 4, 2015 . 1 changed file with 27 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -28,3 +28,30 @@ backporting a patch 3. hack hack hack 4. commit changes 5. git review stable/havana creating a new oslo library --------------------------- .. code-block: bash cd /tmp mkdir graduation cd graduation git clone git://git.openstack.org/openstack/oslo-incubator git clone git://git.openstack.org/openstack/oslo-incubator oslo.io cd oslo.io ../oslo-incubator/tools/graduate.sh io openstack/common/fileutils.py tests/unit/test_fileutils.py # may not be necessary, but they didn't run for me # $bindir/apply_cookiecutter.sh $new_lib # git add . # git commit -m "exported from oslo-incubator by graduate.sh" 1. Add missing dependencies 2. Fix broken imports 3. Make sure the tests run 4. Make sure pep8 passes 5 Syncing dependencies from the incubator git remote add stevemart https://github.com/stevemart/oslo.io.git git push -u stevemart master -
stevemart revised this gist
Mar 11, 2015 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -26,5 +26,5 @@ backporting a patch 1. create a branch 2. git checkout -b your_branch_name remotes/origin/stable/havana 3. hack hack hack 4. commit changes 5. git review stable/havana -
stevemart revised this gist
Mar 11, 2015 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -25,6 +25,6 @@ backporting a patch 1. create a branch 2. git checkout -b your_branch_name remotes/origin/stable/havana 3. hack hack hack 4 commit changes 5. git review stable/havana -
stevemart revised this gist
Mar 11, 2015 . 1 changed file with 9 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -19,3 +19,12 @@ Undo a git commit amend 1. git reflog (to find the number) 2. git reset --soft HEAD@{number} 3. git commit -C HEAD@{number} backporting a patch ------------------- 1. create a branch 2. git checkout -b your_branch_name remotes/origin/stable/havana 3. # hack hack hack 4 # commit changes 5. git review stable/havana -
stevemart revised this gist
Mar 11, 2015 . 1 changed file with 3 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -16,6 +16,6 @@ Local rebasing Undo a git commit amend ----------------------- 1. git reflog (to find the number) 2. git reset --soft HEAD@{number} 3. git commit -C HEAD@{number} -
stevemart renamed this gist
Mar 11, 2015 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
stevemart revised this gist
Mar 11, 2015 . 1 changed file with 13 additions and 12 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,20 +1,21 @@ Remote Rebasing --------------- Click "Rebase" button in the Gerrit UI under your patch set. Local rebasing -------------- 1. git review -d $PARENT_CHANGE_NUMBER 2. git review -x $BROKEN_CHANGE_NUMBER 3. fix the issues 4. git add 5. git cherry-pick --continue 6. git review Undo a git commit amend ----------------------- git reflog (to find the number) git reset --soft HEAD@{number} git commit -C HEAD@{number} -
stevemart renamed this gist
Sep 19, 2014 . 1 changed file with 8 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -10,3 +10,11 @@ Local rebasing. 1. Checkout and create local branch of the dependent review - git review -d $PARENT_CHANGE_NUMBER 2. Cherry-pick your review's most recent patch set - copied from Gerrit UI 3. Push up - git review -R Undo a git commit amend - http://stackoverflow.com/questions/1459150/how-to-undo-git-commit-amend-done-instead-of-git-commit git reflog (to find the number) git reset --soft HEAD@{number} git commit -C HEAD@{number} -
stevemart created this gist
Aug 27, 2014 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,12 @@ Rebase On Dependent - https://wiki.openstack.org/wiki/Gerrit_Workflow#Rebase_On_Dependent Gerrit Rebase Button Click "Rebase" button in the Gerrit UI under your patch set. Local rebasing. This requires copying the "cherry-pick" option provided in the child's patch set details of the Gerrit UI. The reason git review -R is done is because it should be up to the parent to rebase based on its parent. If a conflict occurs it should be their responsibility to fix the conflict and your responsibility to rebase off of that fix. 1. Checkout and create local branch of the dependent review - git review -d $PARENT_CHANGE_NUMBER 2. Cherry-pick your review's most recent patch set - copied from Gerrit UI 3. Push up - git review -R