Git 将本地代码提交到码云

环境配置:

(1)下载安装Git Bash,具体步骤就不赘述了;
(2)双击运行“Git Bash”,配置用户名及邮箱:

$ git config --global user.name "xxxxxxx"
$ git config --global user.email "[email protected]"

创建同步项目步骤:

(1)登陆码云账号,创建相应项目,得到项目地址,如:

https://git.oschina.net/xxxx/PAE.git;

如果账户已经配置好

如果账户已经配置好,git客户端也安装好,在将要上传的文件中,右键打开Git Bash Here,按如下步骤即可:

    1. git init
    2. git remote add origin "你的码云项目地址(ssh或https)"

开始提交项目

    3. git pull origin master
    4. git touch init .txt  //如果已经存在更改的文件,则操作这一步,否则跳过即可
    5. git add .
    6. git commit -m "初始提交"
    7. git push origin master

你可能感兴趣的:(Git)