Be smart. Think open source.
Restore
Archive
Collaboration
server-client
CVS, SVN, ...
Distributed
Git, Mercurial, ...
Distributed offline VCS
git log --graph --decorate --abbrev-commit --all --pretty=oneline
git config user.name "John Doe"
git config user.email "john.doe@example.org"
git init project1
cd project1
touch file1
git add file1 # (not persistent, only signaling)
git commit -m "My first commit" # (persistent)
git branch feature-1 # create a branch
git checkout -b feature-2 # create and switch to branch
touch file2
git add file2 # stage file for next commit
git commit -m "Adding feature file2" # commit the changes
git checkout master
git merge feature-2
git checkout master
git merge --no-ff feature-2
# clone a remote repository and switch into it
git clone https://github.com/keachi/octocat.git && cd octocat
git remote show
git remote show origin
git checkout origin/dev -b dev
git checkout master
(create/edit some content)
git status
git checkout -- . # undo changes
git checkout 5e620bb -B master
# create branch feature-1
git checkout origin/master -B master
git branch feature-1
(or)
git checkout origin/master -B feature-1
git branch # list local branches
git branch --remotes # list only remote branches
git branch --all # list all branches
git branch -d feature-1
# create branch feature-1
git checkout origin/master -B feature-1
(add an exclamation mark to the end of the line in octocat.txt)
git add .
git commit -m 'some comment'
git merge origin/dev # a merge confict happens
git status
git diff
(fix the confict with your favorite editor)
git diff
git add octocat.txt
git merge --continue
git log
git log --oneline --decorate --graph --all
(open a terminal in another empty directory)
$ git init --bare
$ pwd
/home/user/bare
$ (go to your first repository)
$ pwd
/home/user/octocat
$ git remote add bare /home/user/bare
$ git remote show
git checkout master # switch from feature-1 to master branch
git branch --remotes # nothing in repository bare
git push bare master # push local master to remote bare
git branch --set-upstream-to=bare/master # track remote branch
git branch --remotes # branch master is in repository bare too
git fetch bare # fetch changes from bare
git push bare :master # remove branch master remote
# Use one single commit and apply it to the local branch
git cherry-pick d17cfc8 # <-- points to a commit on
# https://github.com/keachi/octocat
# reset all tracked files and checkout branch master
git reset --hard master
# create a tag on the current commit
git tag v1.0.0 -m 'Version 1.0.0'
# create a tag on a specific commit
git tag v0.5.0 -m 'Version 0.5.0' 5e620bb
git push --tags
# list all tags
git tag
# cleanup unnecessary files and optimize the local repository
git gc
Pages
Wiki
Issues
Merge requests
Todos
Milestones
CI/CD pipelines
Issue and MR templates
Container registry
Admin permissions
Standard user
Group owner
GitLab admin
Project namespace
User permissions
Project permissions
Issue template
Merge Request method
Approvals
Grant access by groups
Add special access to users or groups
Webhooks
Trigger by different actions
Services, e.g.
Jira
Bugzilla
Mattermost
Special SSH Keys for deploying
Full repository access
Used to deploying and in CI/CD
Access restriction
Allow only some users to push to certain branches
Allow only to merge in certain branches
Worker for CI/CD pipelines
Enforce additional rules for merging
Run after push on HEAD
Key-Value-pair
Used in CI/CD as environment variables
e.g.
Credentials
Run parameters
Trigger a URL for special API calls
e.g.
build documentation
deploy website
Run on special GitLab worker hosts
e.g.
Compile software
Run linting software
Create artifacts
Issues
Merge requests
Milestones
Wiki
Issue tracker
Manage project issues
Labels
Milestones
Assign to someone
Time tracking
Due date
Weight
Corresponding branch (same or forked repository)
Reviewing code before merge into master
Comments
CI/CD pipeline
Work in progress (WIP)
Fix/resolv issue
Global Administration
Project
User
Group
Monitoring
Released frequently
Update badge in admin area
asap: Security issues
soon: New features
up-to-date: Newest version
Be smart. Think open source.