zoukankan      html  css  js  c++  java
  • git记录

    1.创建项目
    首先登录到到github网站。登录用户名密码。然后“New repository”建自己的项目名称。如myweb
    2.在本地选择项目目录。如myweb,然后进入myweb文件夹。输入“git init”,这样这个目录里面的内容就会被git管理起来了
    3.把本地项目myweb加入到本地仓库。命令是在myweb文件夹下,执行命令“git add *”。把所有的都加入本地仓库。然后提交。命令是“git commit -m ‘这个地方是注释’”
    4.建立本地仓库和远程仓库的连接。命令是git remote add {$remote_name} {$clone_url}。其中remote_name是自己起的一个别名。如myweb。clone_url是github网站上自己创建的项目。也就是1中创建的项目的连接。如1中建立的myweb的连接是https://github.com/yanghuiping/myweb.git,这样就可以用别名myweb代替https://github.com/yanghuiping/myweb.git了。
    5.把本地的仓库中的代码提交到github网站上去。命令是:git push myweb(别名,也可以是地址https://github.com/yanghuiping/myweb.git) master
    6.执行完成之后就提交到github上了。当然这个时候需要输入网站的用户名和密码。

    总结:

    1.创建一个本地仓库并与在线仓库关联
    git init;
    git add .
    git commit -m "添加注释"
    git remote add {$remote_name} {$clone_url}
    git push {$remote_name} master
    2.克隆一个在线仓库
    git clone {$clone_url}
    3.将一个在线仓库的代码和本地的仓库代码合并
    git fetch {$remote_name}
    git merge {$remote_name}/master

    删除一个项目:

    1.登录网站>进入你的项目>点击右边的Settings>点击下方的“Delete this repository”,即可进行删除。

  • 相关阅读:
    Jenkins+Ansible+Gitlab自动化部署三剑客(四)--Jenkins Linux shell集成
    Jenkins+Ansible+Gitlab自动化部署三剑客(三)--Jenkins
    腾讯云从业者线上课程(一)--云计算技术架构
    腾讯云从业者线上课程(一)--云计算发展历史
    nmcli 静态方式添加IP地址
    nmcli
    systemctl 控制单元
    ansible组件 Ad-Hoc
    ansible 定义主机用户和密码
    ansible 主机清单 /etc/ansible/hosts
  • 原文地址:https://www.cnblogs.com/yanghuiping/p/4000199.html
Copyright © 2011-2022 走看看