Add SmartGit instructions to README

This commit is contained in:
Leonard Smith 2020-10-13 13:23:46 -05:00
parent 8891e723a4
commit 25128eedc6
4 changed files with 53 additions and 0 deletions

View File

@ -0,0 +1,53 @@
#Managing git branches with SmartGit for en_ulb_tagged repository
## Setup a Fork of the en_ulb_tagged repository from within Gitlab
The following setups will create a complete copy of the source repository under your user name.
1. Login to the WA Gitlab server:
1. Navigate to https://content.bibletranslationtools.org
2. Click "Sign In" in the upper right corner
3. Enter your sign in credentials.
2. Navigate to the en_ulb_tagged repo: https://content.bibletranslationtools.org/WycliffeAssociates/en_ulb_tagged
3. Click on the fork button in just under the "Sign In" button on the upper right: ![Image of the repo header with fork button on the right of the page][doc_images/fork_button.png]
4. On the "New Repository Fork" page, click the green "Fork Repository" button to create your new fork.
## Clone your new forked repository to your local computer
After the following steps, you will have a complete copy of your forked repo on your local computer.
1. Navigate to your newly cloned repository in Gitlab (if it is not already open).
2. Next to the blue "New File" and "Upload File" buttons select and copy the URL to clone the repo:
![Image of the clone URL location][doc_images/clone_url.png]
3. Open SmartGit.
4. Select Repository > Clone from the application menu.
5. Paste the clone URL into the Repository URL: ![Image of Remote Repository URL textbox][doc_images/repo_url.png]
6. Click "Continue."
7. On the following screen make sure "Include modules" and "Fetch all Heads and Tags" are both checked.
8. In the next screen enter or select the folder where you want to save your cloned repo and click "Finish."
## Create a new working branch from master
When working with git repositories, it is best practice to create a new working branch upon which to apply your new work. This keeps the master branch clean and makes it easier
to keep your forked repository in sync with the main/source repository. If you apply all of your changes to the master branch, you could end up with conflicts with the main/source
branch that must be reconciled by hand. Therefore, the following steps walk you through setting up your new working branch.
1. Open SmartGit.
2. Locate the pane labeled "Repositories" and make sure you have selected and activated the en_ulb_tagged repo.
3. Locate the "Branches" pane and select and double click the "master" branch or right click it and select "Checkout".
4. Select Branch > Add Branch from the SmartGit menu OR press F7 to open the Add Branch dialog.
5. Enter a name for your new branch. Keep your branch name simple, but expressive. Also, make it lowercase. For example, "colossians-check-edits" would be a good name for working
on the final edits for Colossians.
6. Click "Add Branch & Checkout" to create your new branch and checkout the branch. Checking out a branch makes that branch active so that any commits you make get applied to the new branch instead of master.
NOTE: You will want to create separate branches for the various stages of your work. Doing so makes tracking your changes and organizing updates to the main repository easier. Trying to apply all of your work to one large branch can make merging work back to the main repo difficult as the work progresses.
## Commit progress to your working branch
When you commit your work is entirely up to you, but it makes sense to make commits whenever there is a natural/clear transition. For instance, if you change the structure of the XML by changing the name
of one of the attributes but you also need to update the translation in the <w> tags separate the two pieces into separate commits. Make the structural changes and commit the work to your working branch.
Then work on the translation issues and create another commit. That way, if we need to track down the source of a change it will be easier.
1. With SmartGit open and the repository active, double click on your working branch to check it out.
2. Assuming that you have already made your edits to the source files, locate your changed files in the "Files" pane.
3. Highlight the file(s) you want to include in the new commit.
4. With the files highlighted, right click select "Commit" from the popup context menu.
5. In the opened commit dialog, select the files you want to include in this commit and add a commit message. Make sure your commit message indicates the changes you are saving.
6. Click "Commit".

BIN
doc_images/clone_url.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

BIN
doc_images/fork_button.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

BIN
doc_images/repo_url.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB