Difference between revisions of "Instructions for Working with GlueX Git Repositories"

From GlueXWiki
Jump to: navigation, search
(Created page with "==The Workflow== # create local repository #* git clone https:/github.com/jeffersonlab/sim-recon # create a local topic branch #* git branch my\_work # move to the new topic...")
 
(The Workflow)
 
(8 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
==The Workflow==
 
==The Workflow==
  
# create local repository
+
Let's use the halld_recon repository as an example.
#* git clone https:/github.com/jeffersonlab/sim-recon
+
 
# create a local topic branch
+
# Create local repository in the current directory
#* git branch my\_work
+
#* <code>git clone https://github.com/jeffersonlab/halld_recon</code>
# move to the new topic branch
+
# Create a local branch
#* git checkout my\_work
+
#* <code>cd halld_recon</code>
 +
#* <code>git branch bug_removal</code>
 +
# Check-out the new branch
 +
#* <code>git checkout bug_removal</code>
 
# ... work on topic branch, make changes, add them, commit them...
 
# ... work on topic branch, make changes, add them, commit them...
# push local topic branch to public topic branch
+
# Push local branch to public branch
#* git push origin my\_work:new\_bug\_fix
+
#* <code>git push origin -u bug_removal</code>
#* creates branch "new\_bug\_fix" on public repository
+
#* creates branch "bug_removal" on public repository
# issue pull request
+
# Issue pull request
#* go to the GitHub site and log in
+
#* navigate to the branch, click on "pull request"
+
#* creates action item on GitHub
+
#* requests that changes on branch "new\_bug\_fix" be merged onto master branch on public repository
+
# someone else acts on pull request on GitHub
+
 
#* go to the GitHub site and log in
 
#* go to the GitHub site and log in
#* navigate to open pull requests
+
#* navigate to the repository page (https://github.com/JeffersonLab/halld_recon)
#* merge in changes
+
#* click on "branches" on the "code" tab
 +
#* find the line for the "bug_removal" branch
 +
#* click on "pull request" on that line
 +
#* fill in and submit web form
 +
#** essentially creates action item on GitHub, a request that changes on branch "bug_removal" be merged into master branch
 +
# Ask someone else to act on pull request. Pull requesters cannot merge their own request. The person doing the merge:
 +
#* goes to the GitHub site and logs in
 +
#* navigates to the repository page (e.g., https://github.com/JeffersonLab/halld_recon)
 +
#* clicks on "pull requests" in the right-hand column
 +
#* selects the relevant pull request
 +
#* if required, submits a review of the pull request
 +
#* fills in the merge form and initiates the merge
  
 
==Notes on this Workflow==
 
==Notes on this Workflow==
  
 
* Everyone needs an account on GitHub.
 
* Everyone needs an account on GitHub.
* Anyone can update the master branch.
+
* Anyone can push to the master branch from their private repository. No one should.
* Changes should go onto topic branches, but enforced only administratively.
+
* Changes should go onto topic branches; this is enforced only administratively.

Latest revision as of 19:27, 13 May 2020

The Workflow

Let's use the halld_recon repository as an example.

  1. Create local repository in the current directory
  2. Create a local branch
    • cd halld_recon
    • git branch bug_removal
  3. Check-out the new branch
    • git checkout bug_removal
  4. ... work on topic branch, make changes, add them, commit them...
  5. Push local branch to public branch
    • git push origin -u bug_removal
    • creates branch "bug_removal" on public repository
  6. Issue pull request
    • go to the GitHub site and log in
    • navigate to the repository page (https://github.com/JeffersonLab/halld_recon)
    • click on "branches" on the "code" tab
    • find the line for the "bug_removal" branch
    • click on "pull request" on that line
    • fill in and submit web form
      • essentially creates action item on GitHub, a request that changes on branch "bug_removal" be merged into master branch
  7. Ask someone else to act on pull request. Pull requesters cannot merge their own request. The person doing the merge:
    • goes to the GitHub site and logs in
    • navigates to the repository page (e.g., https://github.com/JeffersonLab/halld_recon)
    • clicks on "pull requests" in the right-hand column
    • selects the relevant pull request
    • if required, submits a review of the pull request
    • fills in the merge form and initiates the merge

Notes on this Workflow

  • Everyone needs an account on GitHub.
  • Anyone can push to the master branch from their private repository. No one should.
  • Changes should go onto topic branches; this is enforced only administratively.