git和svn

git基础使用

去git大全

Git 大全 - Gitee.com

  1. 初始化自己的代码库,修改好配置 global就是全局的,配置账号密码,生成ssh秘钥即可

  2. # 显示当前的Git配置
    $ git config --list
    
    # 编辑Git配置文件
    $ git config -e [--global]
    
    # 设置提交代码时的用户信息
    $ git config [--global] user.name "[name]"
    $ git config [--global] user.email "[email address]"
    
  3. 设置秘钥 ssh秘钥(去搜教程)

把远程仓库中的东西克隆到本地文件中

复制github你的项目的ssh地址xxx

右键选择用git工具在当前地址打开

git clone xxx

文件上传提交

进入仓库的地址。

  • 这里的 “.”代表的是当前所有已经修改过的目录

    git add . 
    
  • 查看当前上传状态,你就会发现提交的新文件

    git status
    
  • 提交(这里是提交到了本地) -m 表示该次提交的备注,必填

    git commit -m "xxx"
    
  • 需要提交到远程仓库中去
    :git push "当前用户" “提交的分支”

    git push origin master
    

git常用命令

找开源项目的一些途径

https://github.com/trending/
https://github.com/521xueweihan/HelloGitHub
https://github.com/ruanyf/weekly
https://www.zhihu.com/column/mm-fe

特殊的查找资源小技巧-常用前缀后缀

• 找百科大全 awesome xxx
• 找例子 xxx sample
• 找空项目架子 xxx starter / xxx boilerplate
• 找教程 xxx tutorial

常用git命令

1、git 将代码提交到另一个新仓库

换一种说法就是,从一个git仓库拷贝到另一个git仓库。

做法:以镜像推送的方式上传代码到新的仓库地址

git push --mirror http://...(目标仓库地址)

2、将本地的项目push到远程仓库

将本地项目上传到码云,每个步骤都有图文

posted @ 2022-08-15 02:20  没有烦恼的猫猫  阅读(26)  评论(0)    收藏  举报