深圳男生快快乐乐

python 学习中

Git 基本工作(最先进的分布式版本控制系统)

1、Git, 首先,在https://github.com注册一个新用户。

2、下载安装Git,http://git-scm.com/downloads

3、或者用淘宝镜像:https://registry.npmmirror.com/binary.html?path=git-for-windows

4、远程仓库:

  A、在码云 上https://gitee.com 注册一个新用户。

  B、新建仓库

  C、SSH公钥绑定(设置本机绑定SSH,实现免密联络远程仓库):

    进入本地电脑:c:/users/Administrator/.ssh

    打开git bash 命令窗口,执行:

    ssh-keygen -t rsa 

    会在(c:/users/Administrator/.ssh)目录下生成两个ssh文件:

     id_rsa

     id_rsa.pub

    打开文件: id_rsa.pub,把里面的内容COPY到以下:

    在码云https://gitee.com,登录后,打开个人设置,在SSH公钥,把COPY内容Paste到这里。

5、Git 配置: 打开git bash 命令窗口,执行:其中" "的内容为码云https://gitee.com中仓库下载中的提示:如

git config --global user.name "runoob"
git config --global user.email "test@runoob.com"

6、工作流程:

  A、 工作目录:当前工作目录,不做改变。最好在克隆一个空的本地仓库,后做为工作目录。

  B、暂存文件:git add .

  C、提交更改:git commit -m "更改注释"      (将暂存区的更改提交到本地仓库,并添加提交信息)

  D、拉取更改:git push (将本地的提交推送到远程仓库)

  E、克隆仓库:git clone "https://github.com/username/repo.git" (” “为远程仓库地址)

7、最后在PyCharm中使用,在左下角,打开Terminal,下拉选择Git Bash,执行git的命令(git add.   ;  git commit -m ”new add “ ; git push  ; )

8、Git 基础工作完成。

posted on 2024-09-01 23:13  深圳男生快快乐乐  阅读(1)  评论(0编辑  收藏  举报

导航