git:start

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
git:start [2021/10/17 21:18] jmerarigit: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) : 
 +<code>
 git mergetool git mergetool
 +</code>
  
-===== Setup SSH Connection to Github =====+===== Using Git with SSH Connection =====
 ==== Why use SSH ? ==== ==== Why use SSH ? ====
-Security. For a private repository, only authorized personnel can push, or even just clone. +Compare to HTTPS, using SSH is more secure. You never send your username and password accros the network. For a private repository, SSH is much preferred.
-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, the other key is still secure. For refreshment about SSH, see [[:ssh|OpenSSH]]
 +<code>
 +ssh-keygen -t ed25519 -C "jim.merari@gmail.com"
 +</code>
 +2. Go to your account setting menu in bitbucket.org/github.com/gitlab.com. Find the page related to SSH/GPG. The page will list all the keys that have been associated with your account. Copy the content of your newly generated public key to the corresponding setting form. See more detail on each respective website ([[https://support.atlassian.com/bitbucket-cloud/docs/set-up-an-ssh-key/|Bitbucket]], [[https://docs.github.com/en/authentication/connecting-to-github-with-ssh/about-ssh|Gitbub]]).
  
- +After the new key listed, then you can push/fetch with the command : 
-check SSH key that you already have -> see ~/.ssh +<code>
-see if there's one of the following files: +
-    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 : +
- +
- ssh-keygen -t ed25519 -C "your_email@example.com" +
- +
-to connect to github.com, it is highly recommended to use the ed25519 key type. +
-put your email as key's comment (the "-C" option) to remind you the purpose/context of this key +
- +
- +
-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 "jim.merari@gmail.com" as the key comment, you might use "id_ed25519_jimmerarigmail" as the filename. +
- +
-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 ".pub" prefix is the public key. +
- +
-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/gadget/clients you intend to use with this key +
-- copy the content of the ".pub" file to the form +
-- click the button +
- +
-After the new key listed, then you can push/fetch from github with the command :+
 git push ssh://git@github.com:jmerari/some-repo.git git push ssh://git@github.com:jmerari/some-repo.git
 git push ssh://git@bitbucket.org:jmerari/some-repo.git git push ssh://git@bitbucket.org:jmerari/some-repo.git
 +</code>
  
-If you generate key without passphrase, this git command won't ask for passwordBut if you generated the key with passphrase, you will need to type it hereRemember, this is the password for the key, not the github.com password.+https://blog.developer.atlassian.com/different-ssh-keys-multiple-bitbucket-accounts/
  
- 
- 
-https://docs.github.com/en/authentication/connecting-to-github-with-ssh/about-ssh 
-https://support.atlassian.com/bitbucket-cloud/docs/set-up-an-ssh-key/ 
-https://blog.developer.atlassian.com/different-ssh-keys-multiple-bitbucket-accounts/ 
  • git/start.txt
  • Last modified: 2021/10/19 08:54
  • by jmerari