How to Use Git

All this pages are about how to use git, a code manager.

clone a repo or project

1
git clone <Git repo URL>

Something should be customized before

  • who are you?
1
2
git config --global user.name leejkee
git config --global user.email leejykee@yeah.net
  • the default branch for git init
1
git config --global init.defaultBranch main

Quick Start for my github

  • step 1: create a new repository in your github
  • step 2: select your directory your want to upload
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
# initilize your dir
git init
# add all your new files
git add .
# commit your changes
git commit -m "<message about this commit>"
# push your changes to remote repo 
# firstly
git remote add origin <your repo url>
git push -u origin main
# normally
git push origin main

Using for ssh-keygen

what is ssh-keygen?
Ssh-keygen is a tool for creating new authentication key pairs for SSH . Such key pairs are used for automating logins, single sign-on, and for authenticating hosts.

  • a example
1
ssh-keygen -t rsa -b 4096 -C <your email or others>

Something details are shown in SSH Website. Then, upload your public key to your github.

Licensed under CC BY-NC-SA 4.0
comments powered by Disqus
Built with Hugo
Theme Stack designed by Jimmy