marp | _class | |
---|---|---|
true |
|
Raphael Guntersweiler [email protected]
- Password-less authentication
- Command line basics
- Alternatives to Sourcetree
How to authenticate without a password?
- no need for domain password
- blocked domain account doesn't block you from working
- Open your Git Bash
- Generate your SSH key
$ ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (/home/raphael/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/raphael/.ssh/id_rsa.
Your public key has been saved in /home/raphael/.ssh/id_rsa.pub.
The key fingerprint is:
SHA256:0123456789abcdefghijklmnopqrstuvwxyz+-/0123 raphael@machine
The key's randomart image is:
+---[RSA 2048]----+
| |
| |
| |
| |
+----[SHA256]-----+
- Print and copy your SSH Public Key
$ cat ~/.ssh/id_rsa.pub
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCjWf5lpYZmZDyZ7dGHeyN8YvXDN16HNS3P8cjusKGd
znQXq30B/zv/i5Mv8Is/a1vN2y1pUMw/rPgsRHgUFkE0LzjepdmotEXE4urDaLHJhm2jy14I4jvTghdL
7kZrU0Vmu6tXuo7PUG1pCk1psknb3veM1gR0/Ty3gnvsiTYQor8V94pYhMfbwuE30ZRT87K8iNBPI488
DpQEJ+g1L+Fi495BQh98EOgZWmxIe1gJePwIGKjQYbDSQ4nV9vlaloG+oWqU0AiBJ8fHs4I+rFGo64q2
6VWOEiJhOPO95DTpSk38r6lm7Tf65RR0JsCZ1kfPqiANGJQ6SV2/ZQY9cADX raphael@machine
- Open your Bitbucket profile and add your SSH public key.
- Change your existing repositories remote to SSH.
$ git remote set-url origin <SSH URL>
- Test your change
$ git pull
Already up to date.
yes, I know the stock image shows HTML code
Change directory
$ cd <dir>
List files
$ ls
# or with more details
$ ls -la
Create directory
mkdir <dirname>
Print complete file content
$ cat <file>
# or with paging support
$ less <file>
Print first / last 10 lines of a file
$ head <file>
$ tail <file>
Create an empty file
$ touch <file>
Copy file
$ cp <file> <newFile>
Rename / move file
$ mv <oldFile> <newFile>
Delete file (Note: no Recycle Bin here!)
$ rm <file>
$ rm -rf <directory>
Clear console output
$ clear
Edit a file in the terminal
$ nano <file>
# or if you feel brave (or have no other choice)
$ vi <file>
Helpful hint for vi
/vim
: You leave the editor by typing :q!
$ git clone <Repo URL>
Cloning into 'my-cool-repo'...
remote: Enumerating objects: 12, done.
remote: Total 12 (delta 0), reused 0 (delta 0)
Receiving objects: 100% (12/12), done.
Add a file
$ git add file.txt
Stage a file for commit
$ git stage file.txt
Commit staged files
$ git commit -m "Your Commit Message"
$ git status
On branch master
Changes to be committed:
(use "git restore --staged <file>..." to unstage)
modified: file.txt
"Unstage" a file
$ git reset file.txt
Push your changes
$ git push
Pull changes from remote
$ git pull
Fetch changes (without downloading them)
$ git fetch
Deletes all local changes and returns to the last commit
$ git reset --hard HEAD
List all files to be cleaned
$ git clean -d -n -X
Actually clean the files
$ git clean -d -f -X
List all branches
$ git branch
Create and check out an existing branch
$ git checkout -b <branch>
Check out an existing branch
$ git checkout <branch>
Check out a remote branch
$ git checkout -b <branch> <remote>/<branch>
# e.g.
$ git checkout -b my-branch origin/my-branch
Because command lines can get exhausting at times
- Simple
- Already integrated with Git installation
- Visually clunky
- Doesn't "hold your hand" at all (=> everything is DIY)
- Modern looking
- Supports multiple repositories (tabs)
- Installs into User profile (no admin required)
- Free edition not permitted for commercial use
- Use requires a GitKraken account
- Clean and simple structure
- Quick Launch (type your action)
- Also installs into User profile
- Issue tracker link (e.g. JIRA tickets)
- Free!
- honestly, I couldn't come up with anything (yet)
https://git-scm.com/downloads/guis/
or ask your local search engine of choice
-
Integration works great for the normal workflow
-
If you use VS Code to do your work, use it!
-
Note: Most commands are best issued through the command palette (
F1
)
- Integration (called "Team Explorer") is simple and works well enough for most tasks
- VS2017 works well, VS2019 finally supports stashing
- Conflict resolution is excellent
- Line-wise commiting
- Change lists (put your changes into a "playlist")
- Conflict resolution is also excellent
- If you use Rider (or any Jetbrains IDE), use it!
Raphael Guntersweiler [email protected]