【问题标题】:How to link Django 2.2.5 web framework to GitHub?如何将 Django 2.2.5 Web 框架链接到 GitHub?
【发布时间】:2019-09-13 08:59:56
【问题描述】:

我在 GitHub 上创建了一个存储库,并在 Pycharm Django 设置中登录了我的帐户。目前我对终端命令没有任何运气。我不知道这是否是正确的做事方式?

看起来我已经尝试过适用于旧版本 Django 的命令。

git init

【问题讨论】:

  • 您可以git clone <location>将其克隆到本地,请参阅help.github.com/en/articles/cloning-a-repository
  • 您是否正在尝试将您的 Django 项目上传到 Github?
  • @Sahil 我正在尝试进行版本控制,这样我就不会丢失我的项目。我假设可以将我的项目上传到 Github?
  • @WillemVanOnsem 谢谢,我去看看
  • 我已经给出了答案尝试一下。

标签: python django git github


【解决方案1】:

我假设您正在尝试将您的 Django 项目上传到 Github,所以这些是您可以遵循的步骤。

# initialize your project as a git repository. 
git init
# this will add an origin, meaning, where the files will be uploaded.
git remote add origin https://github.com/<username>/repository-name.git
# this will add all the files to your working tree
git add . 
# this will commit your code 
git commit -m "Your message as to what you have changed in code"
# this will push the code to Github, on master branch.
git push origin master

【讨论】:

  • 我得到一个错误......'git'不是内部或外部命令、可运行程序或批处理文件。
  • 您需要在系统上安装git 并将其添加到您的路径中。你用的是 Windows 还是 Ubuntu
  • 我使用的是 Windows。是“pip install git”吗?
  • git 不是 python 包,我的意思是它可能是,但我说的 Git 是这个 git-scm.com/downloads,如果你在 linux 上,你可以简单地输入 sudo apt install git
  • 休息一下,稍后回来,SO社区一直在线:)
猜你喜欢
  • 2022-12-30
  • 1970-01-01
  • 1970-01-01
  • 2016-07-20
  • 1970-01-01
  • 1970-01-01
  • 2016-02-10
  • 2011-08-10
  • 2017-11-26
相关资源
最近更新 更多