Start
Initiate local repository:
git config --global user.name <First Last>
git config --global user.email <email@example.com>
git init # Initialize a git repositoryWhat we need most:
git add <file(s)> # Add files/changes to git
git commit # Commit added files
git status # Repository info/statusWhat we need to connect Online-/Remote-Repositories
# Once to connect:
git remote add origin https://gitlab.example.com/<repository-owner-name>/<repository-name>.git
git push # Push new commits to remote (GitLab)
git pull # Pull new commits from remote (GitLab)Get Information
Check repository status summary:
git statusCheck history and old commits:
git logCheck differences:
git diff # for diff of uncommited changes
git diff <old_commit_hash> # for diff against old commit
git diff origin # for diff remote repositoryCheck Differences:
Add files:
git add <file(s)>Stage (optional alias for add):
git stage <file(s)>See also: Git and GitLab Introduction, MOC Computing DevOps and Software