This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision | |||
|
quick:gitlab_setup [2024/10/21 09:07] bbarsch removed |
— (current) | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ====== Procedure to update user db code ====== | ||
| - | |||
| - | |||
| - | ===== Clone the userdb code from the Gitlab Repo===== | ||
| - | 1. Go to the directory you want to clone the repo to | ||
| - | |||
| - | |||
| - | 2. Go to the repo in Gitlab and copy the ssh link: | ||
| - | < | ||
| - | git@git: | ||
| - | </ | ||
| - | |||
| - | 3. Note that git should be pointing to scp and not lengau, therefore in my .ssh/config file git2 points to scp so I use '' | ||
| - | |||
| - | < | ||
| - | BBarsch@BBARSCH-NB1 MINGW64 / | ||
| - | $ git clone git@git2: | ||
| - | Cloning into ' | ||
| - | Enter passphrase for key '/ | ||
| - | remote: Enumerating objects: 425, done. | ||
| - | |||
| - | </ | ||
| - | |||
| - | Passphrase was Csir20... | ||
| - | |||
| - | |||
| - | 4. Open your IDE, using sublime, and make changes to the code. | ||
| - | |||
| - | < | ||
| - | BBarsch@BBARSCH-NB1 MINGW64 / | ||
| - | $ cd protea_database/ | ||
| - | |||
| - | BBarsch@BBARSCH-NB1 MINGW64 / | ||
| - | $ | ||
| - | |||
| - | </ | ||
| - | |||
| - | 5. Save the code and check the '' | ||
| - | |||
| - | < | ||
| - | BBarsch@BBARSCH-NB1 MINGW64 / | ||
| - | $ git status | ||
| - | On branch master | ||
| - | Your branch is up to date with ' | ||
| - | |||
| - | nothing to commit, working tree clean | ||
| - | |||
| - | BBarsch@BBARSCH-NB1 MINGW64 / | ||
| - | $ | ||
| - | |||
| - | </ | ||
| - | |||
| - | |||
| - | |||
| - | 6. Next step is to push the code | ||
| - | |||
| - | ===== Push the code back to Gitlab - Master ===== | ||
| - | |||
| - | 1. Update, add, delete code and files. For demonstration we will just modify the README.md text for example. | ||
| - | Then go to that directory you did the clone from and hence the update and say '' | ||
| - | | ||
| - | < | ||
| - | BBarsch@BBARSCH-NB1 MINGW64 / | ||
| - | $ git status | ||
| - | On branch master | ||
| - | Your branch is up to date with ' | ||
| - | |||
| - | Changes not staged for commit: | ||
| - | (use "git add < | ||
| - | (use "git restore < | ||
| - | modified: | ||
| - | |||
| - | no changes added to commit (use "git add" and/or "git commit -a") | ||
| - | |||
| - | BBarsch@BBARSCH-NB1 MINGW64 / | ||
| - | $ | ||
| - | |||
| - | |||
| - | </ | ||
| - | |||
| - | 2. this should show something is modified, and recommends you do '' | ||
| - | |||
| - | < | ||
| - | BBarsch@BBARSCH-NB1 MINGW64 / | ||
| - | $ git add README.md | ||
| - | |||
| - | </ | ||
| - | |||
| - | 4. Then do a commit '' | ||
| - | |||
| - | < | ||
| - | BBarsch@BBARSCH-NB1 MINGW64 / | ||
| - | $ git commit -m " | ||
| - | [master b7ea92ab] 18-Feb-2021 Test Commit | ||
| - | 1 file changed, 3 insertions(+) | ||
| - | |||
| - | |||
| - | </ | ||
| - | |||
| - | |||
| - | 5. And check with git status again that it has been added | ||
| - | |||
| - | < | ||
| - | BBarsch@BBARSCH-NB1 MINGW64 / | ||
| - | $ git status | ||
| - | On branch master | ||
| - | Your branch is ahead of ' | ||
| - | (use "git push" to publish your local commits) | ||
| - | |||
| - | nothing to commit, working tree clean | ||
| - | </ | ||
| - | |||
| - | |||
| - | 6. Then lastly push the code to gitlab use '' | ||
| - | |||
| - | < | ||
| - | BBarsch@BBARSCH-NB1 MINGW64 / | ||
| - | $ git push | ||
| - | Enter passphrase for key '/ | ||
| - | Enumerating objects: 5, done. | ||
| - | Counting objects: 100% (5/5), done. | ||
| - | Delta compression using up to 12 threads | ||
| - | Compressing objects: 100% (3/3), done. | ||
| - | Writing objects: 100% (3/3), 323 bytes | 161.00 KiB/s, done. | ||
| - | Total 3 (delta 2), reused 0 (delta 0), pack-reused 0 | ||
| - | To git2: | ||
| - | | ||
| - | |||
| - | |||
| - | |||
| - | </ | ||
| - | | ||
| - | |||
| - | maybe asked for a passphrase, use '' | ||
| - | |||
| - | Next we need to update the user database | ||
| - | |||
| - | ===== Push the code back to Gitlab - " | ||
| - | 1. Update, add, delete code and files. For demonstration we will just modify the README.md text for example. Now change to another branch by using '' | ||
| - | |||
| - | < | ||
| - | BBarsch@BBARSCH-NB1 MINGW64 / | ||
| - | $ git checkout -b bb_new_branch | ||
| - | Switched to a new branch ' | ||
| - | |||
| - | </ | ||
| - | |||
| - | 2. Now check your status: | ||
| - | |||
| - | < | ||
| - | BBarsch@BBARSCH-NB1 MINGW64 / | ||
| - | $ git status | ||
| - | On branch bb_new_branch | ||
| - | Changes not staged for commit: | ||
| - | (use "git add < | ||
| - | (use "git restore < | ||
| - | modified: | ||
| - | |||
| - | no changes added to commit (use "git add" and/or "git commit -a") | ||
| - | |||
| - | |||
| - | </ | ||
| - | |||
| - | 3. Now add '' | ||
| - | |||
| - | < | ||
| - | BBarsch@BBARSCH-NB1 MINGW64 / | ||
| - | $ git add README.md | ||
| - | |||
| - | BBarsch@BBARSCH-NB1 MINGW64 / | ||
| - | $ git status | ||
| - | On branch bb_new_branch | ||
| - | Changes to be committed: | ||
| - | (use "git restore --staged < | ||
| - | modified: | ||
| - | |||
| - | |||
| - | </ | ||
| - | |||
| - | 4. Then make the commit: | ||
| - | |||
| - | < | ||
| - | BBarsch@BBARSCH-NB1 MINGW64 / | ||
| - | $ git commit -m "Test push" | ||
| - | [bb_new_branch 785e724a] Test push | ||
| - | 1 file changed, 3 insertions(+) | ||
| - | |||
| - | |||
| - | </ | ||
| - | |||
| - | 5. Then push the code: | ||
| - | |||
| - | < | ||
| - | BBarsch@BBARSCH-NB1 MINGW64 / | ||
| - | $ git push | ||
| - | fatal: The current branch bb_new_branch has no upstream branch. | ||
| - | To push the current branch and set the remote as upstream, use | ||
| - | |||
| - | git push --set-upstream origin bb_new_branch | ||
| - | |||
| - | </ | ||
| - | |||
| - | 6. Note this is different to how you do it with '' | ||
| - | |||
| - | < | ||
| - | |||
| - | BBarsch@BBARSCH-NB1 MINGW64 / | ||
| - | $ git push --set-upstream origin bb_new_branch | ||
| - | Enter passphrase for key '/ | ||
| - | Enumerating objects: 5, done. | ||
| - | Counting objects: 100% (5/5), done. | ||
| - | Delta compression using up to 12 threads | ||
| - | Compressing objects: 100% (3/3), done. | ||
| - | Writing objects: 100% (3/3), 311 bytes | 311.00 KiB/s, done. | ||
| - | Total 3 (delta 2), reused 0 (delta 0), pack-reused 0 | ||
| - | remote: | ||
| - | remote: To create a merge request for bb_new_branch, | ||
| - | remote: | ||
| - | remote: | ||
| - | To git2: | ||
| - | * [new branch] | ||
| - | Branch ' | ||
| - | |||
| - | |||
| - | </ | ||
| - | |||
| - | Now when you try to merge on Gitlab: | ||
| - | |||
| - | {{quick: | ||
| - | |||