Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision | |||
| git:start [2021/10/17 21:18] – jmerari | git:start [2021/10/19 08:54] (current) – jmerari | ||
|---|---|---|---|
| Line 10: | Line 10: | ||
| ===== Resolving Conflict ===== | ===== Resolving Conflict ===== | ||
| - | to open UI tool, | + | Provided that you already setup the merge tool to your favorite software (Kdiff3 or others) : |
| + | < | ||
| git mergetool | git mergetool | ||
| + | </ | ||
| - | ===== Setup SSH Connection | + | ===== Using Git with SSH Connection ===== |
| ==== Why use SSH ? ==== | ==== Why use SSH ? ==== | ||
| - | Security. For a private repository, | + | Compare to HTTPS, using SSH is more secure. You never send your username and password accros the network. For a private repository, |
| - | Convenience without entering password. | + | |
| + | ==== Step by Step ==== | ||
| + | 1. Create key pair for your account. Put your email as Comment (CLI option -C) on this key. If you use the same email for Bitbucket, Github, and Gitlab, you can use the same key for all of them. Using different key is more secure. If one key compromised, | ||
| + | < | ||
| + | ssh-keygen -t ed25519 -C " | ||
| + | </ | ||
| + | 2. Go to your account setting menu in bitbucket.org/ | ||
| - | + | After the new key listed, then you can push/fetch with the command : | |
| - | check SSH key that you already have -> see ~/.ssh | + | < |
| - | see if there' | + | |
| - | id_rsa.pub | + | |
| - | id_ecdsa.pub | + | |
| - | id_ed25519.pub | + | |
| - | if exists, then you already have some SSH keys. | + | |
| - | + | ||
| - | Generate new key | + | |
| - | use the following command : | + | |
| - | + | ||
| - | | + | |
| - | + | ||
| - | to connect to github.com, it is highly recommended to use the ed25519 key type. | + | |
| - | put your email as key's comment (the " | + | |
| - | + | ||
| - | + | ||
| - | When you're prompted to "Enter a file in which to save the key," use a descriptive name to easily identify which key related to what identity. | + | |
| - | For example : if you use " | + | |
| - | + | ||
| - | When prompted to fill the passphrase, you can choose to use password or leave it blank. | + | |
| - | + | ||
| - | So this key will correspond to that specific email. | + | |
| - | ssh-keygen will generate two files : the private and the public key. the one with " | + | |
| - | + | ||
| - | go to github.com, login as usual, click the Settings under the profile menu. | + | |
| - | Then open the SSH/GPG menu. The page will list all the keys that have associated them with your account. | + | |
| - | To add new key, | + | |
| - | - click New Key | + | |
| - | - fill the form with descriptive name. specify what device/ | + | |
| - | - copy the content of the " | + | |
| - | - click the button | + | |
| - | + | ||
| - | After the new key listed, then you can push/ | + | |
| git push ssh:// | git push ssh:// | ||
| git push ssh:// | git push ssh:// | ||
| + | </ | ||
| - | If you generate key without passphrase, this git command won't ask for password. But if you generated the key with passphrase, you will need to type it here. Remember, this is the password for the key, not the github.com password. | + | https:// |
| - | |||
| - | |||
| - | https:// | ||
| - | https:// | ||
| - | https:// | ||