Code Integration - Xcode and GitLab: Difference between revisions

From blinkenwiki

No edit summary
No edit summary
Line 1: Line 1:
'''Check in the first local version.'''
Check in the first local version.
 
<ol>
<ol>
<li> 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.
<li> 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.
- Example: m404-a, m404-b, etc.
<li> Create a private project on GitLab
<li> Create a private project on GitLab
#* Example: m404
- Example: m404
# In Xcode, create a new project with the same name.
<li> In Xcode, create a new project with the same name.
#* Cross-platform/Empty
- Cross-platform/Empty
#* Product Name: m404
 
#* In same folder as m404-a, etc.
- Product Name: m404
#* Create git repository
- In same folder as m404-a, etc.
# Link the new Xcode project to the GitLab project
- Create git repository
#* git remote add origin git@gitlab.com:jimthompson/m404.git
<li> Link the new Xcode project to the GitLab project
#* get push -u origin —all
- git remote add origin git@gitlab.com:jimthompson/m404.git
# Build up the Xcode project:
- get push -u origin —all
#* Copy code from first sibling directory (e.g. m404-a) into Xcode directory, making new subdirectories to organize, and rename code as necessary
<li> Build up the Xcode project:
#:<code>
- 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
- mkdir m404/arduino
</code>
- cp m404-a/M404SD01.ino m404/arduino/m404-demo.ino
#* - Add each new file into the Xcode project (File -> Add Files to “m404”)
- 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
- Each new file should show status ‘A’ in the Xcode project navigator
6. In Xcode:
<li> In Xcode:
- 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”.
- Xcode will ask for a password - at this point, change the authentication type to “SSH Keys”.
7. 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.


If any other local versions exist, commit them on branches and then merge.
If any other local versions exist, commit them on branches and then merge.
8. Use Xcode to create the new branch
<li> Use Xcode to create the new branch
- Source Control -> m404 — master -> new branch
- Source Control -> m404 — master -> new branch
   
   
- m404-b
- m404-b
9. Modify the code in the new branch by copying in from sibling directory
<li> Modify the code in the new branch by copying in from sibling directory
- cp m404-b/M404SD01-SS.ino m404/arduino/m404-demo.ino
- 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)."
- 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)."
10. Merge with the master branch (Source Control -> merge into branch… Choose ‘master’).
<li> Merge with the master branch (Source Control -> merge into branch… Choose ‘master’).
11. Push the changes.
<li> Push the changes.
12. 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.


Repeat 8-12 for other local versions.
Repeat 8-12 for other local versions.

Revision as of 01:45, 13 June 2021

Check in the first local version.

  1. 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.
  2. Create a private project on GitLab - Example: m404
  3. 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
  4. Link the new Xcode project to the GitLab project - git remote add origin git@gitlab.com:jimthompson/m404.git - get push -u origin —all
  5. 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
  6. 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”.
  7. 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.
  8. Use Xcode to create the new branch - Source Control -> m404 — master -> new branch - m404-b
  9. 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)."
  10. Merge with the master branch (Source Control -> merge into branch… Choose ‘master’).
  11. Push the changes.
  12. Verify that the new code is visible at GitLab with the commit message used. Repeat 8-12 for other local versions.