Muestra las diferencias entre dos versiones de la página.
| Ambos lados, revisión anterior Revisión previa Próxima revisión | Revisión previa | ||
|
wiki2:gitconcepts [2018/12/30 16:29] alfred [Basic operations] |
wiki2:gitconcepts [2021/10/01 16:19] (actual) |
||
|---|---|---|---|
| Línea 191: | Línea 191: | ||
| ==== Basic operations ==== | ==== Basic operations ==== | ||
| === Add a subtree to the current project === | === Add a subtree to the current project === | ||
| + | |||
| + | <code> | ||
| + | # Add the new remote to the project | ||
| + | git remote add -f <remote name> <remote address> | ||
| + | # Attach the new code | ||
| + | git subtree add --prefix <folder> <remote name> <branch> --squash | ||
| + | </code> | ||
| + | |||
| + | Example: | ||
| + | <code> | ||
| + | git remote add -f cc_lib http://gitea.codi.coop/codi.cooperatiu/cc_lib.git | ||
| + | git subtree add --prefix cc_lib cc_lib master --squash | ||
| + | </code> | ||
| + | |||
| + | === Pull from remote === | ||
| + | <code> | ||
| + | git fetch <remote name> | ||
| + | git subtree pull --prefix <path> <remote name> <branch> --squash | ||
| + | </code> | ||
| + | |||
| + | Example | ||
| + | <code> | ||
| + | git fetch tpope-vim-surround master | ||
| + | git subtree pull --prefix .vim/bundle/tpope-vim-surround tpope-vim-surround master --squash | ||
| + | </code> | ||
| === Update the remote === | === Update the remote === | ||
| + | //Remind to commit before!!// | ||
| <code> | <code> | ||
| git remote add <remote_name> <remote_address> | git remote add <remote_name> <remote_address> | ||
| Línea 198: | Línea 224: | ||
| </code> | </code> | ||
| + | Example: | ||
| <code> | <code> | ||
| git remote add cc_lib http://gitea.codi.coop/codi.cooperatiu/cc_lib.git | git remote add cc_lib http://gitea.codi.coop/codi.cooperatiu/cc_lib.git | ||
| Línea 203: | Línea 230: | ||
| </code> | </code> | ||
| ===== Notes ===== | ===== Notes ===== | ||
| + | |||
| + | GitLab's **"merge request"** feature is equivalent to GitHub's** "pull request"** feature. Both are means of pulling changes from another branch or fork into your branch and merging the changes with your existing code. They are useful tools for code review and change management. | ||
| + | |||
| + | |||
| ==== Inner architecture ==== | ==== Inner architecture ==== | ||
| Everything stored in git is in a file. When you create a commit it creates a file containing your commit message and associated data (name, email, date/time, previous commit, etc) and links it to a tree file. The tree file contains a list of objects or other trees. | Everything stored in git is in a file. When you create a commit it creates a file containing your commit message and associated data (name, email, date/time, previous commit, etc) and links it to a tree file. The tree file contains a list of objects or other trees. | ||
| Línea 220: | Línea 251: | ||
| * https://www.atlassian.com/git/tutorials/gitignore/ | * https://www.atlassian.com/git/tutorials/gitignore/ | ||
| + | ==== Problems with certificates ==== | ||
| + | |||
| + | You can solve them by [1] [[wiki2:linux_howto#update_system_certificate_authority|updating the certificate authority]] or [2] ''export GIT_SSL_NO_VERIFY=1'' or [3] ''git config --global http.sslverify false''. | ||