`

以PyCharm为例,将自己的代码放在码云/GitHub上

阅读更多

步骤↓

 

  1. 安装git,此处不多说。
  2. 在码云或GitHub上创建项目,本文以码云为例:

     
  3. 进入刚刚创建好的项目的目录,获取项目URL:

     
  4. 进入项目根路径,执行以下代码创建git库:
    #1、Git 全局设置:
    git config --global user.name "杜神"
    git config --global user.email "981040863@qq.com"
    #2、初始化 git 仓库:
    git init
    
    
    touch README.md
    git add *
    git commit -m "first commit"
    git remote add origin https://gitee.com/dushen666/spider.git
    git pull origin master --allow-unrelated-histories
    git push -u origin master
     
  5. 打开码云,可以看到代码已经同步了上去。
  6. 使用pycharm打开项目,可以看到git可以正常使用了:

     
  • 大小: 38.4 KB
  • 大小: 40.6 KB
  • 大小: 53.8 KB
0
0
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics