Skip to content

Commit

Permalink
1-11ssh配置和克隆仓库
Browse files Browse the repository at this point in the history
  • Loading branch information
wydtt authored Oct 6, 2024
1 parent 16666b6 commit 8086dcf
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 0 deletions.
24 changes: 24 additions & 0 deletions notes/1-11ssh配置和克隆仓库.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
cd ~/.ssh
ssh-keygen -t rsa -b 4096

将 生成的id_rsa.pub 放到setting 的sshkey 中

绑定成功直接克隆ssh

slociv@gg ~/l/git> git clone [email protected]:wydtt/TestLab.git
正克隆到 'TestLab'...
警告:您似乎克隆了一个空仓库。
slociv@gg ~/l/git> ls
TestLab/
slociv@gg ~/l/git> cd TestLab/
slociv@gg ~/l/g/TestLab (main)> ls
slociv@gg ~/l/g/TestLab (main)> echo hello>hello.txt
slociv@gg ~/l/g/TestLab (main)> git add .
slociv@gg ~/l/g/TestLab (main)> git commit -m "first commit"
[main(根提交) 630181f] first commit
1 file changed, 1 insertion(+)
create mode 100644 hello.txt


git push 推送本地仓库到远程仓库
git pull 拉取
Binary file added notes/1-8gitrm.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions notes/1-8gitrm删除内容.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
rm 和git rm 是有区别的
rm 内容后需要 git add 才会删除暂存区的内容
所以有点麻烦一般用 git rm -r 递归删除就行了
最后不要忘记了提交 删除版本库里的内容

6 changes: 6 additions & 0 deletions notes/1-9gitignore.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
前提是这里面的文件不能已经添加到版本库中
需要首先 git rm 删除不需要的文件并提交

空文件夹不会纳入版本控制 temp/ 文件夹的格式如上


Binary file added notes/1-9gitignore.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 8086dcf

Please sign in to comment.