website icon indicating copy to clipboard operation
website copied to clipboard

How to move a commit from one repo to another repo

Open JessicaLucindaCheng opened this issue 1 year ago • 6 comments

Overview

We need to write instructions for how to move a commit from one repo to another repo so that leads at Hack for LA can move files between repos when needed.

Action Items

  • [ ] In a new comment below, write instructions for how to move a commit from one repo to another repo.

Resources/Instructions

  • Link to instructions: https://github.com/hackforla/website/issues/6595#issuecomment-2047453668
  • https://www.elliotblackburn.com/cherry-pick-git-commit-across-repository/

JessicaLucindaCheng avatar Apr 08 '24 23:04 JessicaLucindaCheng

@ExperimentsInHonesty Once you prioritize this issue, please assign me to it. Thanks.

JessicaLucindaCheng avatar Apr 08 '24 23:04 JessicaLucindaCheng

[WIP DRAFT] How to move a commit from one repo to another using cherry-pick

Assumptions

  1. You are using GitHub to host your remote repositories.
  2. The repository for where the commits will come from and the repository for where the commits will be moved to already exist or have been created. Also, the repositories have at least one branch, such as the main or master branch. https://github.com/hackforla/website/blob/gh-pages/CONTRIBUTING.md#12-dev-setup-2-installing-git

Instructions

Fork repos

  1. Fork the repo where you want to move the commits to [^1]. For these instructions, I will refer to this as the new-repo.
  2. Fork the repo where you have the commits currently [^1]. For these instructions, I will refer to this as old-repo.
  3. Clone a copy of your forked old-repo to your computer [^3].

For your local repository of old-repo

  1. Add a remote to new-repo [^4][^5].
# [REMOTE-NAME] should be replaced with the name you want for your remote.
# [REMOTE-URL] should be replaced with the URL to the remote repo. The URL will be in the format https://github.com/OWNER/REPOSITORY.git
git remote add [REMOTE-NAME] [REMOTE-URL]

For these instructions, I would use OWNER as hackforla and REPOSITORY as new-repo:

git remote add origin-new https://github.com/hackforla/new-repo.git
  1. Create a new branch based on new-repo's main branch (or whatever branch you want the commits to go to) [^4][^6].
# [NEW-BRANCH-NAME] should be replaced with the name you want for your new branch.
# [NEW-REPO-NAME] should be replaced with the name of the new repository where you want the commits to go to
# [MAIN-BRANCH-NAME] should be replaced with name of the branch where you want commits to go to eventually
git checkout -b [NEW-BRANCH-NAME] --track [NEW-REPO-NAME]/[MAIN-BRANCH-NAME]

For example,

git checkout -b new-repo-branch --track new-repo/main
  1. Cherry-pick the commit(s) you want to move to the new-repo [^4][^7]. Here is the command for one commit:
# [COMMIT-ID] should be replaced with the commit id
git cherry-pick [COMMIT-ID]

For example,

git cherry-pick 792c964
  1. Push cherry-picked commit(s) to the new-repo [^4][^8].
# [NEW-REPO-NAME] should be replaced with the name of the new repository where you want the commits to go to
# [NEW-BRANCH-NAME] should be replaced with the name of the branch you created in step 6.
git push [NEW-REPO-NAME] [NEW-BRANCH-NAME]

Create a pull request and merge the branch into the main branch

[ADD INSTRUCTIONS HERE]

  • I recommend using rebase merging to preserve who authored the file.
  • To see examples of the commit history of the various methods of merging, see these branches in my forked repo:

Remove files from the old repository (if necessary)

[ADD INSTRUCTIONS HERE]

Resources

[^1]: Forking a repository [^2]: Creating a branch [^3]: Cloning your forked repository [^4]: Moving a git commit from one repository to another [^5]: Adding a remote repository [^6]: git checkout [^7]: git cherry-pick [^8]: git push

JessicaLucindaCheng avatar Apr 10 '24 12:04 JessicaLucindaCheng

Issue Progress Update

  • Progress: Started a first draft: https://github.com/hackforla/website/issues/6595#issuecomment-2047453668
  • Blockers: None
  • Availability: 6 hours
  • ETA: Complete a first draft Thursday, April 18, 2024

JessicaLucindaCheng avatar Apr 10 '24 14:04 JessicaLucindaCheng

@JessicaLucindaCheng

Please add update using the below template (even if you have a pull request). Afterwards, remove the 'To Update !' label and add the 'Status: Updated' label.

  1. Progress: "What is the current status of your project? What have you completed and what is left to do?"
  2. Blockers: "Difficulties or errors encountered."
  3. Availability: "How much time will you have this week to work on this issue?"
  4. ETA: "When do you expect this issue to be completed?"
  5. Pictures (optional): "Add any pictures of the visual changes made to the site so far."

If you need help, be sure to either: 1) place your issue in the Questions/In Review column of the Project Board and ask for help at your next meeting, 2) put a "Status: Help Wanted" label on your issue and pull request, or 3) put up a request for assistance on the #hfla-site channel. Please note that including your questions in the issue comments- along with screenshots, if applicable- will help us to help you. Here and here are examples of well-formed questions.

You are receiving this comment because your last comment was before Tuesday, April 23, 2024 at 12:06 AM PST.

github-actions[bot] avatar Apr 26 '24 07:04 github-actions[bot]

@JessicaLucindaCheng

Please add update using the below template (even if you have a pull request). Afterwards, remove the '2 weeks inactive' label and add the 'Status: Updated' label.

  1. Progress: "What is the current status of your project? What have you completed and what is left to do?"
  2. Blockers: "Difficulties or errors encountered."
  3. Availability: "How much time will you have this week to work on this issue?"
  4. ETA: "When do you expect this issue to be completed?"
  5. Pictures (optional): "Add any pictures of the visual changes made to the site so far."

If you need help, be sure to either: 1) place your issue in the Questions/In Review column of the Project Board and ask for help at your next meeting, 2) put a "Status: Help Wanted" label on your issue and pull request, or 3) put up a request for assistance on the #hfla-site channel. Please note that including your questions in the issue comments- along with screenshots, if applicable- will help us to help you. Here and here are examples of well-formed questions.

You are receiving this comment because your last comment was before Tuesday, April 30, 2024 at 12:06 AM PST.

github-actions[bot] avatar May 03 '24 07:05 github-actions[bot]

Issue Progress Update

  • Progress: Started a first draft: https://github.com/hackforla/website/issues/6595#issuecomment-2047453668
  • Blockers: None
  • Availability: 6 hours
  • ETA: June 1, 2024

JessicaLucindaCheng avatar May 05 '24 13:05 JessicaLucindaCheng

@JessicaLucindaCheng

Please add update using the below template (even if you have a pull request). Afterwards, remove the 'To Update !' label and add the 'Status: Updated' label.

  1. Progress: "What is the current status of your project? What have you completed and what is left to do?"
  2. Blockers: "Difficulties or errors encountered."
  3. Availability: "How much time will you have this week to work on this issue?"
  4. ETA: "When do you expect this issue to be completed?"
  5. Pictures (optional): "Add any pictures of the visual changes made to the site so far."

If you need help, be sure to either: 1) place your issue in the Questions/In Review column of the Project Board and ask for help at your next meeting, 2) put a "Status: Help Wanted" label on your issue and pull request, or 3) put up a request for assistance on the #hfla-site channel. Please note that including your questions in the issue comments- along with screenshots, if applicable- will help us to help you. Here and here are examples of well-formed questions.

You are receiving this comment because your last comment was before Tuesday, May 14, 2024 at 12:06 AM PST.

github-actions[bot] avatar May 17 '24 07:05 github-actions[bot]

@JessicaLucindaCheng

Please add update using the below template (even if you have a pull request). Afterwards, remove the '2 weeks inactive' label and add the 'Status: Updated' label.

  1. Progress: "What is the current status of your project? What have you completed and what is left to do?"
  2. Blockers: "Difficulties or errors encountered."
  3. Availability: "How much time will you have this week to work on this issue?"
  4. ETA: "When do you expect this issue to be completed?"
  5. Pictures (optional): "Add any pictures of the visual changes made to the site so far."

If you need help, be sure to either: 1) place your issue in the Questions/In Review column of the Project Board and ask for help at your next meeting, 2) put a "Status: Help Wanted" label on your issue and pull request, or 3) put up a request for assistance on the #hfla-site channel. Please note that including your questions in the issue comments- along with screenshots, if applicable- will help us to help you. Here and here are examples of well-formed questions.

You are receiving this comment because your last comment was before Tuesday, May 21, 2024 at 12:06 AM PST.

github-actions[bot] avatar May 24 '24 07:05 github-actions[bot]

@JessicaLucindaCheng

Please add update using the below template (even if you have a pull request). Afterwards, remove the '2 weeks inactive' label and add the 'Status: Updated' label.

  1. Progress: "What is the current status of your project? What have you completed and what is left to do?"
  2. Blockers: "Difficulties or errors encountered."
  3. Availability: "How much time will you have this week to work on this issue?"
  4. ETA: "When do you expect this issue to be completed?"
  5. Pictures (optional): "Add any pictures of the visual changes made to the site so far."

If you need help, be sure to either: 1) place your issue in the Questions/In Review column of the Project Board and ask for help at your next meeting, 2) put a "Status: Help Wanted" label on your issue and pull request, or 3) put up a request for assistance on the #hfla-site channel. Please note that including your questions in the issue comments- along with screenshots, if applicable- will help us to help you. Here and here are examples of well-formed questions.

You are receiving this comment because your last comment was before Tuesday, May 28, 2024 at 12:06 AM PST.

github-actions[bot] avatar May 31 '24 07:05 github-actions[bot]

Issue Progress Update

  • Progress: Started a first draft: https://github.com/hackforla/website/issues/6595#issuecomment-2047453668
  • Blockers: None
  • Availability: 6 hours
  • ETA: July 1, 2024

JessicaLucindaCheng avatar Jun 06 '24 08:06 JessicaLucindaCheng

@JessicaLucindaCheng

Please add update using the below template (even if you have a pull request). Afterwards, remove the 'To Update !' label and add the 'Status: Updated' label.

  1. Progress: "What is the current status of your project? What have you completed and what is left to do?"
  2. Blockers: "Difficulties or errors encountered."
  3. Availability: "How much time will you have this week to work on this issue?"
  4. ETA: "When do you expect this issue to be completed?"
  5. Pictures (optional): "Add any pictures of the visual changes made to the site so far."

If you need help, be sure to either: 1) place your issue in the Questions/In Review column of the Project Board and ask for help at your next meeting, 2) put a "Status: Help Wanted" label on your issue and pull request, or 3) put up a request for assistance on the #hfla-site channel. Please note that including your questions in the issue comments- along with screenshots, if applicable- will help us to help you. Here and here are examples of well-formed questions.

You are receiving this comment because your last comment was before Tuesday, June 11, 2024 at 12:06 AM PST.

github-actions[bot] avatar Jun 14 '24 07:06 github-actions[bot]

@JessicaLucindaCheng

Please add update using the below template (even if you have a pull request). Afterwards, remove the '2 weeks inactive' label and add the 'Status: Updated' label.

  1. Progress: "What is the current status of your project? What have you completed and what is left to do?"
  2. Blockers: "Difficulties or errors encountered."
  3. Availability: "How much time will you have this week to work on this issue?"
  4. ETA: "When do you expect this issue to be completed?"
  5. Pictures (optional): "Add any pictures of the visual changes made to the site so far."

If you need help, be sure to either: 1) place your issue in the Questions/In Review column of the Project Board and ask for help at your next meeting, 2) put a "Status: Help Wanted" label on your issue and pull request, or 3) put up a request for assistance on the #hfla-site channel. Please note that including your questions in the issue comments- along with screenshots, if applicable- will help us to help you. Here and here are examples of well-formed questions.

You are receiving this comment because your last comment was before Tuesday, June 18, 2024 at 12:06 AM PST.

github-actions[bot] avatar Jun 21 '24 07:06 github-actions[bot]

@JessicaLucindaCheng

Please add update using the below template (even if you have a pull request). Afterwards, remove the '2 weeks inactive' label and add the 'Status: Updated' label.

  1. Progress: "What is the current status of your project? What have you completed and what is left to do?"
  2. Blockers: "Difficulties or errors encountered."
  3. Availability: "How much time will you have this week to work on this issue?"
  4. ETA: "When do you expect this issue to be completed?"
  5. Pictures (optional): "Add any pictures of the visual changes made to the site so far."

If you need help, be sure to either: 1) place your issue in the Questions/In Review column of the Project Board and ask for help at your next meeting, 2) put a "Status: Help Wanted" label on your issue and pull request, or 3) put up a request for assistance on the #hfla-site channel. Please note that including your questions in the issue comments- along with screenshots, if applicable- will help us to help you. Here and here are examples of well-formed questions.

You are receiving this comment because your last comment was before Wednesday, June 19, 2024 at 1:48 PM PST.

github-actions[bot] avatar Jun 22 '24 20:06 github-actions[bot]

@JessicaLucindaCheng

Please add update using the below template (even if you have a pull request). Afterwards, remove the '2 weeks inactive' label and add the 'Status: Updated' label.

  1. Progress: "What is the current status of your project? What have you completed and what is left to do?"
  2. Blockers: "Difficulties or errors encountered."
  3. Availability: "How much time will you have this week to work on this issue?"
  4. ETA: "When do you expect this issue to be completed?"
  5. Pictures (optional): "Add any pictures of the visual changes made to the site so far."

If you need help, be sure to either: 1) place your issue in the Questions/In Review column of the Project Board and ask for help at your next meeting, 2) put a "Status: Help Wanted" label on your issue and pull request, or 3) put up a request for assistance on the #hfla-site channel. Please note that including your questions in the issue comments- along with screenshots, if applicable- will help us to help you. Here and here are examples of well-formed questions.

You are receiving this comment because your last comment was before Tuesday, July 30, 2024 at 12:05 AM PST.

github-actions[bot] avatar Aug 02 '24 07:08 github-actions[bot]

@JessicaLucindaCheng

Please add update using the below template (even if you have a pull request). Afterwards, remove the '2 weeks inactive' label and add the 'Status: Updated' label.

  1. Progress: "What is the current status of your project? What have you completed and what is left to do?"
  2. Blockers: "Difficulties or errors encountered."
  3. Availability: "How much time will you have this week to work on this issue?"
  4. ETA: "When do you expect this issue to be completed?"
  5. Pictures (optional): "Add any pictures of the visual changes made to the site so far."

If you need help, be sure to either: 1) place your issue in the Questions/In Review column of the Project Board and ask for help at your next meeting, 2) put a "Status: Help Wanted" label on your issue and pull request, or 3) put up a request for assistance on the #hfla-site channel. Please note that including your questions in the issue comments- along with screenshots, if applicable- will help us to help you. Here and here are examples of well-formed questions.

You are receiving this comment because your last comment was before Tuesday, August 6, 2024 at 12:04 AM PST.

github-actions[bot] avatar Aug 09 '24 07:08 github-actions[bot]

@JessicaLucindaCheng

Please add update using the below template (even if you have a pull request). Afterwards, remove the '2 weeks inactive' label and add the 'Status: Updated' label.

  1. Progress: "What is the current status of your project? What have you completed and what is left to do?"
  2. Blockers: "Difficulties or errors encountered."
  3. Availability: "How much time will you have this week to work on this issue?"
  4. ETA: "When do you expect this issue to be completed?"
  5. Pictures (optional): "Add any pictures of the visual changes made to the site so far."

If you need help, be sure to either: 1) place your issue in the Questions/In Review column of the Project Board and ask for help at your next meeting, 2) put a "Status: Help Wanted" label on your issue and pull request, or 3) put up a request for assistance on the #hfla-site channel. Please note that including your questions in the issue comments- along with screenshots, if applicable- will help us to help you. Here and here are examples of well-formed questions.

You are receiving this comment because your last comment was before Tuesday, August 13, 2024 at 12:14 PM PST.

HackforLABot avatar Aug 16 '24 19:08 HackforLABot

@JessicaLucindaCheng

Please add update using the below template (even if you have a pull request). Afterwards, remove the '2 weeks inactive' label and add the 'Status: Updated' label.

  1. Progress: "What is the current status of your project? What have you completed and what is left to do?"
  2. Blockers: "Difficulties or errors encountered."
  3. Availability: "How much time will you have this week to work on this issue?"
  4. ETA: "When do you expect this issue to be completed?"
  5. Pictures (optional): "Add any pictures of the visual changes made to the site so far."

If you need help, be sure to either: 1) place your issue in the Questions/In Review column of the Project Board and ask for help at your next meeting, 2) put a "Status: Help Wanted" label on your issue and pull request, or 3) put up a request for assistance on the #hfla-site channel. Please note that including your questions in the issue comments- along with screenshots, if applicable- will help us to help you. Here and here are examples of well-formed questions.

You are receiving this comment because your last comment was before Tuesday, August 27, 2024 at 12:04 AM PST.

HackforLABot avatar Aug 30 '24 07:08 HackforLABot

@JessicaLucindaCheng

Please add update using the below template (even if you have a pull request). Afterwards, remove the '2 weeks inactive' label and add the 'Status: Updated' label.

  1. Progress: "What is the current status of your project? What have you completed and what is left to do?"
  2. Blockers: "Difficulties or errors encountered."
  3. Availability: "How much time will you have this week to work on this issue?"
  4. ETA: "When do you expect this issue to be completed?"
  5. Pictures (optional): "Add any pictures of the visual changes made to the site so far."

If you need help, be sure to either: 1) place your issue in the Questions/In Review column of the Project Board and ask for help at your next meeting, 2) put a "Status: Help Wanted" label on your issue and pull request, or 3) put up a request for assistance on the #hfla-site channel. Please note that including your questions in the issue comments- along with screenshots, if applicable- will help us to help you. Here and here are examples of well-formed questions.

You are receiving this comment because your last comment was before Tuesday, September 3, 2024 at 12:04 AM PST.

HackforLABot avatar Sep 06 '24 07:09 HackforLABot

@JessicaLucindaCheng

Please add update using the below template (even if you have a pull request). Afterwards, remove the '2 weeks inactive' label and add the 'Status: Updated' label.

  1. Progress: "What is the current status of your project? What have you completed and what is left to do?"
  2. Blockers: "Difficulties or errors encountered."
  3. Availability: "How much time will you have this week to work on this issue?"
  4. ETA: "When do you expect this issue to be completed?"
  5. Pictures (optional): "Add any pictures of the visual changes made to the site so far."

If you need help, be sure to either: 1) place your issue in the Questions/In Review column of the Project Board and ask for help at your next meeting, 2) put a "Status: Help Wanted" label on your issue and pull request, or 3) put up a request for assistance on the #hfla-site channel. Please note that including your questions in the issue comments- along with screenshots, if applicable- will help us to help you. Here and here are examples of well-formed questions.

You are receiving this comment because your last comment was before Tuesday, September 10, 2024 at 12:04 AM PST.

HackforLABot avatar Sep 13 '24 07:09 HackforLABot

@JessicaLucindaCheng

Please add update using the below template (even if you have a pull request). Afterwards, remove the '2 weeks inactive' label and add the 'Status: Updated' label.

  1. Progress: "What is the current status of your project? What have you completed and what is left to do?"
  2. Blockers: "Difficulties or errors encountered."
  3. Availability: "How much time will you have this week to work on this issue?"
  4. ETA: "When do you expect this issue to be completed?"
  5. Pictures (optional): "Add any pictures of the visual changes made to the site so far."

If you need help, be sure to either: 1) place your issue in the Questions/In Review column of the Project Board and ask for help at your next meeting, 2) put a "Status: Help Wanted" label on your issue and pull request, or 3) put up a request for assistance on the #hfla-site channel. Please note that including your questions in the issue comments- along with screenshots, if applicable- will help us to help you. Here and here are examples of well-formed questions.

You are receiving this comment because your last comment was before Tuesday, September 17, 2024 at 12:04 AM PST.

HackforLABot avatar Sep 20 '24 07:09 HackforLABot

@JessicaLucindaCheng

Please add update using the below template (even if you have a pull request). Afterwards, remove the '2 weeks inactive' label and add the 'Status: Updated' label.

  1. Progress: "What is the current status of your project? What have you completed and what is left to do?"
  2. Blockers: "Difficulties or errors encountered."
  3. Availability: "How much time will you have this week to work on this issue?"
  4. ETA: "When do you expect this issue to be completed?"
  5. Pictures (optional): "Add any pictures of the visual changes made to the site so far."

If you need help, be sure to either: 1) place your issue in the Questions/In Review column of the Project Board and ask for help at your next meeting, 2) put a "Status: Help Wanted" label on your issue and pull request, or 3) put up a request for assistance on the #hfla-site channel. Please note that including your questions in the issue comments- along with screenshots, if applicable- will help us to help you. Here and here are examples of well-formed questions.

You are receiving this comment because your last comment was before Tuesday, September 24, 2024 at 12:04 AM PST.

HackforLABot avatar Sep 27 '24 07:09 HackforLABot

@JessicaLucindaCheng

Please add update using the below template (even if you have a pull request). Afterwards, remove the '2 weeks inactive' label and add the 'Status: Updated' label.

  1. Progress: "What is the current status of your project? What have you completed and what is left to do?"
  2. Blockers: "Difficulties or errors encountered."
  3. Availability: "How much time will you have this week to work on this issue?"
  4. ETA: "When do you expect this issue to be completed?"
  5. Pictures (optional): "Add any pictures of the visual changes made to the site so far."

If you need help, be sure to either: 1) place your issue in the Questions/In Review column of the Project Board and ask for help at your next meeting, 2) put a "Status: Help Wanted" label on your issue and pull request, or 3) put up a request for assistance on the #hfla-site channel. Please note that including your questions in the issue comments- along with screenshots, if applicable- will help us to help you. Here and here are examples of well-formed questions.

You are receiving this comment because your last comment was before Tuesday, October 1, 2024 at 12:04 AM PST.

HackforLABot avatar Oct 04 '24 07:10 HackforLABot

Issue Progress Update

  • Progress: Started a first draft: https://github.com/hackforla/website/issues/6595#issuecomment-2047453668
  • Blockers: None
  • Availability: Not sure for this issue this week
  • ETA: Will give an updated ETA by October 14, 2024

JessicaLucindaCheng avatar Oct 07 '24 20:10 JessicaLucindaCheng

@JessicaLucindaCheng

Please add update using the below template (even if you have a pull request). Afterwards, remove the 'To Update !' label and add the 'Status: Updated' label.

  1. Progress: "What is the current status of your project? What have you completed and what is left to do?"
  2. Blockers: "Difficulties or errors encountered."
  3. Availability: "How much time will you have this week to work on this issue?"
  4. ETA: "When do you expect this issue to be completed?"
  5. Pictures (optional): "Add any pictures of the visual changes made to the site so far."

If you need help, be sure to either: 1) place your issue in the Questions/In Review column of the Project Board and ask for help at your next meeting, 2) put a "Status: Help Wanted" label on your issue and pull request, or 3) put up a request for assistance on the #hfla-site channel. Please note that including your questions in the issue comments- along with screenshots, if applicable- will help us to help you. Here and here are examples of well-formed questions.

You are receiving this comment because your last comment was before Tuesday, October 15, 2024 at 12:04 AM PST.

HackforLABot avatar Oct 18 '24 07:10 HackforLABot

@JessicaLucindaCheng

Please add update using the below template (even if you have a pull request). Afterwards, remove the '2 weeks inactive' label and add the 'Status: Updated' label.

  1. Progress: "What is the current status of your project? What have you completed and what is left to do?"
  2. Blockers: "Difficulties or errors encountered."
  3. Availability: "How much time will you have this week to work on this issue?"
  4. ETA: "When do you expect this issue to be completed?"
  5. Pictures (optional): "Add any pictures of the visual changes made to the site so far."

If you need help, be sure to either: 1) place your issue in the Questions/In Review column of the Project Board and ask for help at your next meeting, 2) put a "Status: Help Wanted" label on your issue and pull request, or 3) put up a request for assistance on the #hfla-site channel. Please note that including your questions in the issue comments- along with screenshots, if applicable- will help us to help you. Here and here are examples of well-formed questions.

You are receiving this comment because your last comment was before Tuesday, October 22, 2024 at 12:04 AM PST.

HackforLABot avatar Oct 25 '24 07:10 HackforLABot