Git

Deploy Key Generation

List all the ssh file

1
ls -al ~/.ssh

Regenerate a deploy key

1
ssh-keygen -t rsa -b 4096 -C "the_name_of_the_deploy_key"

We can just create a key which name is “the_name_of_the_deploy_key”, if there was an error from the github says there were two duplicated keys we used.ss

View the deploy key

1
vim ~.ssh/id_rsa.pub

or

1
cat ~/.ssh/id_rsa.pub

So after we viewed the key, we can just copy and paste into the Github.

1
git clone http://username:password@247.58.7.177/xxx/xxx.git 

https://stackoverflow.com/questions/10054318/how-do-i-provide-a-username-and-password-when-running-git-clone-gitremote-git

Branch

Here we can only clone just one single branch

1
git clone -b <the_name_of_the_branch> --single-branch https://github.com/...git

Check how many branches

1
git brach
1
git branch -a

Create a new branch:

1
git branch -c <branch_name>

Enable that branch:

1
git workout <branch_name>

Read the variable path

1
vim ~/.bashrc

Check the .git/config

image-20220805200842425

Inside the terminal and click it to enter the git config files, so we can modify the information there.

image-20220805200956551


Git
http://xiaos.site/2022/06/06/Git Tutorials/
Author
Xiao Zhang
Posted on
June 6, 2022
Licensed under