Code Integration - Xcode and GitLab: Difference between revisions
From blinkenwiki
Blinkenjim (talk | contribs) No edit summary |
Blinkenjim (talk | contribs) No edit summary |
||
Line 29: | Line 29: | ||
:* Commit the new files. Use commit message "Initial commit for new code." | :* Commit the new files. Use commit message "Initial commit for new code." | ||
:* Push to the GitLab repository | :* Push to the GitLab repository | ||
:: | ::- Xcode will ask for a password - at this point, change the authentication type to “SSH Keys”. | ||
<li> Verify that the new code is visible at GitLab with the commit message used. | <li> Verify that the new code is visible at GitLab with the commit message used. | ||
Revision as of 01:48, 13 June 2021
Check in the first local version.
- If more that one local copy of the codebase exists, and it’s not clear which one should be “the” version, create multiple local sibling directories.
- Example: m404-a, m404-b, etc.
- Create a private project on GitLab
- Example: m404
- In Xcode, create a new project with the same name.
- Cross-platform/Empty
- Product Name: m404
- In same folder as m404-a, etc.
- Create git repository
- Link the new Xcode project to the GitLab project
git remote add origin git@gitlab.com:jimthompson/m404.git get push -u origin —all
- Build up the Xcode project:
- Copy code from first sibling directory (e.g. m404-a) into Xcode directory, making new subdirectories to organize, and rename code as necessary
mkdir m404/arduino cp m404-a/M404SD01.ino m404/arduino/m404-demo.ino
- Add each new file into the Xcode project (File -> Add Files to “m404”)
- Each new file should show status ‘A’ in the Xcode project navigator
- In Xcode:
- Commit the new files. Use commit message "Initial commit for new code."
- Push to the GitLab repository
- - Xcode will ask for a password - at this point, change the authentication type to “SSH Keys”.
- Verify that the new code is visible at GitLab with the commit message used. If any other local versions exist, commit them on branches and then merge.
- Use Xcode to create the new branch - Source Control -> m404 — master -> new branch - m404-b
- Modify the code in the new branch by copying in from sibling directory - cp m404-b/M404SD01-SS.ino m404/arduino/m404-demo.ino - Commit the changes with an appropriate message: if the intent of the changes is apparent, put that in the commit message. Also put the sibling directory name in the commit message.: "Change demo code to use soft-serial. (From sibling m404-b)."
- Merge with the master branch (Source Control -> merge into branch… Choose ‘master’).
- Push the changes.
- Verify that the new code is visible at GitLab with the commit message used. Repeat 8-12 for other local versions.