Git


Goal is that all administrators can perform the necessary actions properly and according the project policies.

  • GUI + CLI

1. Repository

  1. https://github.com/WackoWiki/wackowiki <— main
  2. https://sourceforge.net/p/wackowiki/code/ <— mirror
  3. 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

2.2. Clone particular version of remote repository

git clone -b branch_or_tag_name repo_address_or_path

git clone -b 6.0.2 https://bitbucket.org/wackowiki/wackowiki.git

git clone -b 6.0.2 https://github.com/WackoWiki/wackowiki.git

2.3. Push branches

git -c credential.helper= -c core.quotepath=false -c log.showSignature=false push --progress --porcelain bitbucket refs/heads/5.5:5.5 --tags
git -c credential.helper= -c core.quotepath=false -c log.showSignature=false push --progress --porcelain bitbucket refs/heads/5.0:5.0 --tags
git -c credential.helper= -c core.quotepath=false -c log.showSignature=false push --progress --porcelain bitbucket refs/heads/4.3:4.3 --tags

Seriously?

2.4. Reset local repository branch to be just like remote repository HEAD

git fetch origin
git reset --hard origin/master

3. Github

3.1. Workflow

The “bread and butter” commands and concepts needed to work with a Github-hosted project.

3.2. Rational


Pro

  • almost all libs we use are on Github
  • API

Contra

  • lock-in
  • GitHub no longer supports languages other than English.

4. Import from Mercurial

Attributions

  1. DidierSpaier
  2. TannSan
  3. ebal
  4. vendeeglobe
  5. Trojer
  6. the0bone
  7. vapaamies
  8. Elar9000
  9. Raysir

4.1. Settings

  1. Requiring a linear commit history
  2. Setting your commit email address
    • 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. Members

  1. ebal
  2. vendeeglobe
  3. Trojer
  4. Elar9000

6. Workflow

7. Testing

  1. merge pull requests
  2. strip an unwanted commit

8. CLI

Action source page doesn't exist yet (/Org / Tools / Repository / Git / CLI?)

9. GUI Clients

9.1. IDE

https://wiki.eclipse.org/EGit/User_Guide


10. Backup Solution

Mitigate lock-in

11. Resources

  1. Comparison of source-code-hosting facilities
  2. Comparison of version-control software

Show Files (2 files)