Git
Goal is that all administrators can perform the necessary actions properly and according the project policies.
- GUI + CLI
1. Repository
- https://github.com/WackoWiki/wackowiki <-- main
- https://sourceforge.net/p/wackowiki/code/ <-- mirror
- https://bitbucket.org/wackowiki/wackowiki/ <-- dev
1.1. Legacy
interwiki.conf-
Revision
--> Mercurial -
Commit
--> Git
UPDATE doc_page SET body = REPLACE(body, 'source:default/', 'source:master/')
1.2. Layout
1.3. .gitattributes
* text eol=lf *.png binary *.gif binary *.ico binary .gitattributes export-ignore .gitignore export-ignore composer.json export-ignore composer.lock export-ignore
1.4. .gitignore
# WackoWiki /cache/* !/cache/.htaccess /cache/config/* !/cache/config/.htaccess /cache/feed/* !/cache/feed/.htaccess /cache/page/* !/cache/page/.htaccess /cache/query/* !/cache/query/.htaccess /cache/session/* !/cache/session/.htaccess /cache/template/* !/cache/template/.htaccess /file/backup/* !/file/backup/.htaccess /file/global/* !/file/global/wacko_logo.png /file/perpage/* !/file/perpage/.htaccess /file/thumb/* !/file/thumb/.htaccess # Eclipse IDE .buildpath .project .settings/ # PHPStorm IDE .idea *.iml
If you are trying to ignore changes to a file that's already tracked in the repository (e.g.
config.php
file that you would need to change for your local environment but you would never want to check in these changes) than what you want to do is:git update-index --skip-worktree <file>
2. Differences to Mercurial
2.1. Purge the last commit
git reset --hard HEAD^ git push origin -f
git reset --hard 71c27777543ccfcb0376dcdd8f6777df055ef479 git push --force
a specific repo:
git push https://git.... --force
2.2. Clone particular version of remote repository
git clone -b branch_or_tag_name repo_address_or_path
git clone -b 6.1.4 https://bitbucket.org/wackowiki/wackowiki.git git clone -b 6.1.4 https://github.com/WackoWiki/wackowiki.git
2.3. Reset local repository branch to be just like remote repository HEAD
git fetch origin git reset --hard origin/master
3. Github
3.1. Workflow
3.2. Rational
Pro
- almost all libs we use are on Github
- API
- lock-in
- GitHub GUI no longer supports languages other than English.
3.3. Settings
Creating a personal access token[link1]Personal access tokens function like ordinary OAuth access tokens. They can be used instead of a password for Git over HTTPS, or can be used to authenticate to the API over Basic Authentication.
https://bitbucket.org/blog/dep[...]api-and-git-activity[link2]
3.4. Two-factor authentication (2FA)
https://github.blog/2023-03-09[...]2fa-begins-march-13/[link3] - mandatory
https://docs.github.com/en/aut[...]actor-authentication[link4]
2FA methods
- TOTP
- SMS
- security keys
- GitHub Mobile
F-Droid
- FreeOTP[link5]
- Aegis Authenticator[link6]
Linux
- GNOME Authenticator
- Keysmith[link7] (KDE)
4. Import from Mercurial
4.1. Settings
- Requiring a linear commit history[link8]
- Setting your commit email address[link9]
-
commit eae3fd3461492b2396b66f9d7d7441f611775005 Author: vendeeglobe <54716082+vendeeglobe@users.noreply.github.com> 2019-08-24 17:28:56 Committer: vendeeglobe <54716082+vendeeglobe@users.noreply.github.com> 2019-08-24 17:28:56
-
5. Workflow
6. Testing
- merge pull requests
- strip an unwanted commit
7. CLI
You aren't allowed to read this page.12. GUI Clients
- Clients[link10]
12.1. IDE
https://wiki.eclipse.org/EGit/User_GuideWorking with Eclipse[link11]
13. Backup Solution
Mitigate lock-in14. Resources
self-hosting
- [link1] https://docs.github.com/en/github/authenticating-to-github/creating-a-personal-access-token
- [link2] https://bitbucket.org/blog/deprecating-atlassian-account-password-for-bitbucket-api-and-git-activity
- [link3] https://github.blog/2023-03-09-raising-the-bar-for-software-security-github-2fa-begins-march-13/
- [link4] https://docs.github.com/en/authentication/securing-your-account-with-two-factor-authentication-2fa/about-two-factor-authentication
- [link5] https://f-droid.org/packages/org.fedorahosted.freeotp/
- [link6] https://f-droid.org/en/packages/com.beemdevelopment.aegis/
- [link7] https://apps.kde.org/de/keysmith/
- [link8] https://help.github.com/en/github/administering-a-repository/requiring-a-linear-commit-history
- [link9] https://help.github.com/en/github/setting-up-and-managing-your-github-user-account/setting-your-commit-email-address
- [link10] https://wackowiki.org/doc/Org/Tools/Repository/Git/Client
- [link11] https://wackowiki.org/doc/Org/Tools/Repository/Git/Client/Eclipse
- [link12] https://en.wikipedia.org/wiki/Comparison_of_source_code_hosting_facilities
- [link13] https://en.wikipedia.org/wiki/Comparison_of_version_control_software