Difference between revisions of "Moodle, ownCloud, GitLab, MediaWiki, vsCode, NetBeans"

From Rhomicom Wiki
Jump to navigation Jump to search
 
(30 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
== GIT ==
 
== GIT ==
#Add Public SSH Key
+
* Install
ssh-keygen -t ed25519 -C "RHO_ERP_WEB_KEY"
+
  sudo dnf install git -y
GhanaRhomicom@2021|Passphrase
+
  git --version
nano /c/Users/richa/.ssh/id_ed25519.pub
+
* Add Public SSH Key
 +
  ssh-keygen -t ed25519 -C "your_email@example.com"
 +
  eval "$(ssh-agent -s)"
 +
  ssh-add /path/to/key/id_ed25519
 +
  nano /path/to/key/id_ed25519.pub
 +
* Test SSH Keys
 +
  ssh -T git@github.com # Attempts to ssh to GitHub
 +
* Git global setup
 +
  git config --global user.name "Allen 123"
 +
  git config --global user.email "[[/cdn-cgi/l/email-protection|[email protected]]]"
 +
  git config --global core.autocrlf input
 +
* Create a new repository
 +
  git credential-manager clear
 +
  git clone https://gitlab.rhomicom.com/richard/rho_erp_web.git
 +
  cd rho_erp_web
 +
  touch README.md
 +
  git add README.md
 +
  git commit -m "add README"
 +
  git push -u origin master
 +
* Push an existing folder
 +
  cd existing_folder |cd /c/RHO_ERP_WEB
 +
  git init
 +
  git remote add origin https://gitlab.rhomicom.com:8443/richard/rho_erp_web.git
 +
  git add .
 +
  git commit -m "Initial ERP Web commit"
 +
  git push -u origin master
 +
* Push an existing Git repository
 +
  cd existing_repo
 +
  git remote rename origin old-origin
 +
  git remote add origin https://gitlab.rhomicom.com:8443/richard/rho_erp_web.git
 +
  git push -u origin --all
 +
  git push -u origin --tags
 +
* Merge Development Branch into master
 +
  git checkout master
 +
  git merge richard/main
  
Command line instructions
+
  git stash
You can also upload existing files from your computer using the instructions below.
+
  # Then, pull in the changes from origin.
 +
  git fetch origin && git rebase origin/(branch name)
 +
  # Next, add the stash back in to your working directory:
 +
  git stash pop
 +
  # Revert Commits to Previous Commit
 +
  git revert -m 1 c3b57799354139c1b760ce91f3e9d84bc3d72635 # Reverse Merge
 +
  git revert 93b1ad2951ab26170177375ee5ad12184f608ad7 # Reverse Commit
 +
  git commit
 +
  git push origin master
  
 +
  # This will create three separate revert commits:
 +
  git revert a867b4af 25eee4ca 0766c053
  
#Git global setup
+
  # It also takes ranges. This will revert the last two commits:
git config --global user.name "Richard Mensah"
+
  git revert HEAD~2..HEAD
git config --global user.email "richarda.mensah@gmail.com"
 
  
Create a new repository
+
  #Similarly, you can revert a range of commits using commit hashes (non inclusive of first hash):
git clone https://gitlab.rhomicom.com:8443/richard/rho_erp_web.git
+
  git revert 0d1d7fc..a867b4a
cd rho_erp_web
 
touch README.md
 
git add README.md
 
git commit -m "add README"
 
git push -u origin master
 
  
Push an existing folder
+
  # Reverting a merge commit
cd existing_folder |cd /c/RICHARD/RHOAPPS/RHO_ERP_WEB
+
  git revert -m 1 <merge_commit_sha>
git init
 
git remote add origin https://gitlab.rhomicom.com:8443/richard/rho_erp_web.git
 
git add .
 
git commit -m "Initial ERP Web commit"
 
git push -u origin master
 
  
Push an existing Git repository
+
  # To get just one, you could use `rebase -i` to squash them afterwards
cd existing_repo
+
  # Or, you could do it manually (be sure to do this at top level of the repo)
git remote rename origin old-origin
+
  # get your index and work tree into the desired state, without changing HEAD:
git remote add origin https://gitlab.rhomicom.com:8443/richard/rho_erp_web.git
+
  git checkout 0d1d7fc32 .
git push -u origin --all
 
git push -u origin --tags
 
  
 +
  # Then commit. Be sure and write a good message describing what you just did
 +
  git commit
  
git stash
+
  # Setup folder for git
# Then, pull in the changes from origin.
+
  echo "# mobileapp" >> README.md
git fetch origin && git rebase origin/(branch name)
+
  git init
# Next, add the stash back in to your working directory:
+
  git add README.md
git stash pop
+
  git commit -m "first commit"
 +
  git branch -M main
 +
  git remote add origin https://github.com/TACMS/mobileapp.git
 +
  git push -u origin main
  
echo "# mobileapp" >> README.md
+
  ssh-keygen -t ed25519 -C "[[/cdn-cgi/l/email-protection|[email protected]]]"
git init
+
  ls -al ~/.ssh
git add README.md
+
  eval `ssh-agent -s`
git commit -m "first commit"
+
  ssh-add ~/.ssh/id_ed25519
git branch -M main
+
  nano ~/.ssh/id_ed25519.pub
git remote add origin https://github.com/TACMS/mobileapp.git
 
git push -u origin main
 
  
 +
  git merge --no-ff --no-commit test
 +
  git clone --single-branch --branch <branchname> <remote-repo>
 +
  git clone --single-branch --branch richard/main [[/cdn-cgi/l/email-protection|[email protected]]]:TACMS/erp.git
 +
* COMMIT and MERGE with main branch
 +
  git add .
 +
  git commit -m "Start working on User List"
 +
  git push -u origin richard/main
 +
  git checkout main
 +
  git merge --no-ff --no-commit richard/main
 +
  git commit -m "Start working on User List"
 +
  git push -u origin main
 +
  git checkout richard/main
 +
  git pull origin main
 +
  git push -u origin richard/main
 +
* GIT ALIASES (#)
 +
  git config --global alias.add-commit '!git add -A && git commit'
 +
  git add-commit -m 'My commit message' #On Windows, one should use double-quotes (")
 +
== GITLAB ==
 +
  GRANT ALL ON rho_wiki.* TO 'rho_wikiuser'@'%';
 +
  GRANT CREATE ROUTINE, CREATE TEMPORARY TABLES, LOCK TABLES, ALTER, CREATE, CREATE VIEW, DELETE, DELETE HISTORY, DROP, INDEX, INSERT, REFERENCES, SELECT, SHOW VIEW,
 +
  TRIGGER, UPDATE, ALTER ROUTINE, EXECUTE ON rho_wiki TO 'rho_wikiuser'@'localhost';
  
 +
  cat /etc/php/7.4/cli/conf.d/0-upload_large_dumps.ini
 +
  upload_max_filesize = 128M
 +
  post_max_size = 128M
 +
  memory_limit = 1G
 +
  max_execution_time = 600
 +
  max_input_vars = 5000
  
ssh-keygen -t ed25519 -C "richarda.mensah@gmail.com"
+
  find . \( -name "*.gz" -o -name "*.log" -o -name "*.s" -o -name "*.u" \) -exec rm -v {} \;
ls -al ~/.ssh
+
  find . \( -name "*.gz" -o -name "*.log" -o -name "*.s" -o -name "*.u" \) -delete
eval `ssh-agent -s`
+
  find . \( -name "*.gz" -o -name "*.log" -o -name "*.s" -o -name "*.u" \)
ssh-add ~/.ssh/id_ed25519
 
nano ~/.ssh/id_ed25519
 
  
 
+
  # If the gitlab container fails to start due to permission problems try to fix it by executing:
git clone --single-branch --branch <branchname> <remote-repo>
+
  docker exec -it gitlab update-permissions
git clone --single-branch --branch bernard/main git@github.com:TACMS/backendapi.git
+
  docker restart gitlab

Latest revision as of 17:12, 12 August 2023

GIT

  • Install
 sudo dnf install git -y
 git --version
  • Add Public SSH Key
 ssh-keygen -t ed25519 -C "your_email@example.com"
 eval "$(ssh-agent -s)"
 ssh-add /path/to/key/id_ed25519
 nano /path/to/key/id_ed25519.pub
  • Test SSH Keys
 ssh -T git@github.com # Attempts to ssh to GitHub
  • Git global setup
 git config --global user.name "Allen 123"
 git config --global user.email "[email protected]"
 git config --global core.autocrlf input
  • Create a new repository
 git credential-manager clear
 git clone https://gitlab.rhomicom.com/richard/rho_erp_web.git
 cd rho_erp_web
 touch README.md
 git add README.md
 git commit -m "add README"
 git push -u origin master
  • Push an existing folder
 cd existing_folder |cd /c/RHO_ERP_WEB
 git init
 git remote add origin https://gitlab.rhomicom.com:8443/richard/rho_erp_web.git
 git add .
 git commit -m "Initial ERP Web commit"
 git push -u origin master
  • Push an existing Git repository
 cd existing_repo
 git remote rename origin old-origin
 git remote add origin https://gitlab.rhomicom.com:8443/richard/rho_erp_web.git
 git push -u origin --all
 git push -u origin --tags
  • Merge Development Branch into master
 git checkout master
 git merge richard/main
 git stash
 # Then, pull in the changes from origin.
 git fetch origin && git rebase origin/(branch name)
 # Next, add the stash back in to your working directory:
 git stash pop
 # Revert Commits to Previous Commit
 git revert -m 1 c3b57799354139c1b760ce91f3e9d84bc3d72635 # Reverse Merge
 git revert 93b1ad2951ab26170177375ee5ad12184f608ad7 # Reverse Commit
 git commit
 git push origin master
 # This will create three separate revert commits:
 git revert a867b4af 25eee4ca 0766c053
 # It also takes ranges. This will revert the last two commits:
 git revert HEAD~2..HEAD
 #Similarly, you can revert a range of commits using commit hashes (non inclusive of first hash):
 git revert 0d1d7fc..a867b4a
 # Reverting a merge commit
 git revert -m 1 <merge_commit_sha>
 # To get just one, you could use `rebase -i` to squash them afterwards
 # Or, you could do it manually (be sure to do this at top level of the repo)
 # get your index and work tree into the desired state, without changing HEAD:
 git checkout 0d1d7fc32 .
 # Then commit. Be sure and write a good message describing what you just did
 git commit
 # Setup folder for git
 echo "# mobileapp" >> README.md
 git init
 git add README.md
 git commit -m "first commit"
 git branch -M main
 git remote add origin https://github.com/TACMS/mobileapp.git
 git push -u origin main
 ssh-keygen -t ed25519 -C "[email protected]"
 ls -al ~/.ssh
 eval `ssh-agent -s`
 ssh-add ~/.ssh/id_ed25519
 nano ~/.ssh/id_ed25519.pub
 git merge --no-ff --no-commit test
 git clone --single-branch --branch <branchname> <remote-repo>
 git clone --single-branch --branch richard/main [email protected]:TACMS/erp.git
  • COMMIT and MERGE with main branch
 git add .
 git commit -m "Start working on User List"
 git push -u origin richard/main
 git checkout main
 git merge --no-ff --no-commit richard/main
 git commit -m "Start working on User List"
 git push -u origin main
 git checkout richard/main
 git pull origin main
 git push -u origin richard/main
  • GIT ALIASES (#)
 git config --global alias.add-commit '!git add -A && git commit'
 git add-commit -m 'My commit message' #On Windows, one should use double-quotes (")

GITLAB

 GRANT ALL ON rho_wiki.* TO 'rho_wikiuser'@'%';
 GRANT CREATE ROUTINE, CREATE TEMPORARY TABLES, LOCK TABLES, ALTER, CREATE, CREATE VIEW, DELETE, DELETE HISTORY, DROP, INDEX, INSERT, REFERENCES, SELECT, SHOW VIEW, 
 TRIGGER, UPDATE, ALTER ROUTINE, EXECUTE ON rho_wiki TO 'rho_wikiuser'@'localhost';
 cat /etc/php/7.4/cli/conf.d/0-upload_large_dumps.ini
  upload_max_filesize = 128M
  post_max_size = 128M
  memory_limit = 1G
  max_execution_time = 600
  max_input_vars = 5000
 find . \( -name "*.gz" -o -name "*.log" -o -name "*.s" -o -name "*.u" \) -exec rm -v {} \;
 find . \( -name "*.gz" -o -name "*.log" -o -name "*.s" -o -name "*.u" \) -delete
 find . \( -name "*.gz" -o -name "*.log" -o -name "*.s" -o -name "*.u" \)
 # If the gitlab container fails to start due to permission problems try to fix it by executing:
 docker exec -it gitlab update-permissions
 docker restart gitlab