最新消息:20210816 当前crifan.com域名已被污染,为防止失联,请关注(页面右下角的)公众号

[记录]通过git命令行把已有的PyCharm项目代码上传到OSChina的git上

Git crifan 2413浏览 0评论

折腾:

[已解决]把PyCharm的项目源码导入到远程的git仓库中

去找了很多帖子, 但是没有说的清楚的。

所以干脆自己去用git命令行去操作吧。

Last login: Thu Sep  1 09:58:12 on ttys006
➜  sourcecode ll
total 3000
drwxr-xr-x   8 crifan  staff   272B  8 22 10:57 Framework7
drwxr-xr-x  14 crifan  staff   476B  9  2 14:36 flask
-rw-r–r–   1 crifan  staff   1.5M  9  2 14:33 sipevents_20160902_backup.zip
➜  sourcecode pwd
/Users/crifan/dev/dev_root/daryun/SIPEvents/sourcecode
Cloning into ‘sipevents’…
remote: Counting objects: 4, done.
remote: Compressing objects: 100% (3/3), done.
remote: Total 4 (delta 0), reused 0 (delta 0)
Unpacking objects: 100% (4/4), done.
Checking connectivity… done.
➜  sourcecode ll
total 3000
drwxr-xr-x   8 crifan  staff   272B  8 22 10:57 Framework7
drwxr-xr-x  14 crifan  staff   476B  9  2 14:36 flask
drwxr-xr-x   5 crifan  staff   170B  9  2 14:49 sipevents
-rw-r–r–   1 crifan  staff   1.5M  9  2 14:33 sipevents_20160902_backup.zip
➜  sourcecode

去拷贝已有的项目源码:

粘贴到clone下面的,远端的git目录中:

 然后编辑:

.gitignore

内容为:

# PyCharm
# http://www.jetbrains.com/pycharm/webhelp/project.html
.idea
.iml
# Mac
.DS_Store
# external PyCharm lib
wechat_sdk/
wechat-python-sdk

然后再去命令行中看看:

好像就可以了,然后再去添加进去:

➜  sourcecode cd sipevents
➜  sipevents git:(master) ll
total 48
-rw-r–r–   1 crifan  staff    12B  9  2 14:49 README.md
-rw-r–r–   1 crifan  staff   436B  8 25 16:47 config.py
-rw-r–r–   1 crifan  staff   6.7K  8 30 17:53 db_create.py
-rw-r–r–   1 crifan  staff   773B  8 29 17:57 db_manager.py
drwxr-xr-x@ 23 crifan  staff   782B  8 23 14:48 flask
drwxr-xr-x   3 crifan  staff   102B  8 29 17:53 instance
-rw-r–r–   1 crifan  staff    77B  8 23 14:39 run.py
drwxr-xr-x   8 crifan  staff   272B  9  2 10:29 sipevents
drwxr-xr-x@ 15 crifan  staff   510B  8 21 10:46 wechat-python-sdk
drwxr-xr-x@ 13 crifan  staff   442B  8 21 17:03 wechat_sdk
➜  sipevents git:(master) git status
On branch master
Your branch is up-to-date with ‘origin/master’.
Changes not staged for commit:
  (use "git add <file>…" to update what will be committed)
  (use "git checkout — <file>…" to discard changes in working directory)
modified:   .gitignore
Untracked files:
  (use "git add <file>…" to include in what will be committed)
flask/
instance/
sipevents/
no changes added to commit (use "git add" and/or "git commit -a")
➜  sipevents git:(master) git add *
The following paths are ignored by one of your .gitignore files:
wechat-python-sdk
wechat_sdk
Use -f if you really want to add them.
➜  sipevents git:(master) git status
On branch master
Your branch is up-to-date with ‘origin/master’.
Changes to be committed:
  (use "git reset HEAD <file>…" to unstage)
new file:   config.py
new file:   db_create.py
new file:   db_manager.py
new file:   flask/__init__.py
new file:   flask/__main__.py
new file:   flask/_compat.py
new file:   flask/app.py
new file:   flask/blueprints.py
new file:   flask/cli.py
new file:   flask/config.py
new file:   flask/ctx.py
new file:   flask/debughelpers.py
new file:   flask/ext/__init__.py
new file:   flask/exthook.py
new file:   flask/globals.py
new file:   flask/helpers.py
new file:   flask/json.py
new file:   flask/logging.py
new file:   flask/sessions.py
new file:   flask/signals.py
new file:   flask/templating.py
new file:   flask/testing.py
new file:   flask/views.py
new file:   flask/wrappers.py
new file:   instance/config.py
new file:   run.py
new file:   sipevents/__init__.py
new file:   sipevents/forms.py
new file:   sipevents/models.py
new file:   sipevents/static/css/datetimepicker/jquery.datetimepicker.css
new file:   sipevents/static/css/datetimepicker/jquery.datetimepicker.min.css
new file:   sipevents/static/css/framework7.ios.colors.css
new file:   sipevents/static/css/framework7.ios.colors.min.css
new file:   sipevents/static/css/framework7.ios.css
new file:   sipevents/static/css/framework7.ios.min.css
new file:   sipevents/static/css/framework7.ios.rtl.css
new file:   sipevents/static/css/framework7.ios.rtl.min.css
new file:   sipevents/static/css/framework7.material.colors.css
new file:   sipevents/static/css/framework7.material.colors.min.css
new file:   sipevents/static/css/framework7.material.css
new file:   sipevents/static/css/framework7.material.min.css
new file:   sipevents/static/css/framework7.material.rtl.css
new file:   sipevents/static/css/framework7.material.rtl.min.css
new file:   sipevents/static/css/my-app.css
new file:   sipevents/static/img/avatar/limao.jpg
new file:   sipevents/static/img/avatar/liyuanfei.jpg
new file:   sipevents/static/img/avatar/navi_add_lightblue_24x24.svg
new file:   sipevents/static/img/avatar/oswjmv02FBc16eCjUsJY3tOEj_wo.png
new file:   sipevents/static/img/avatar/oswjmv4X0cCXcfkIwjoDfCkeTVVY.png
new file:   sipevents/static/img/avatar/oswjmv6AxX5vOgtlsYL8qiPFyB1Q.png
new file:   sipevents/static/img/avatar/oswjmv7kEyDhFfYLQCbJHTlnXdow.png
new file:   sipevents/static/img/avatar/oswjmvw7lf73HT53QHOWwl4-pKr8.png
new file:   sipevents/static/img/avatar/wutao.jpg
new file:   sipevents/static/img/avatar/zhangbinglian.jpg
new file:   sipevents/static/img/avatar/zhouhaixiao.jpg
new file:   sipevents/static/img/i-f7-ios.png
new file:   sipevents/static/img/i-f7-material.png
new file:   sipevents/static/img/i-form-calendar-ios.svg
new file:   sipevents/static/img/i-form-calendar-material.svg
new file:   sipevents/static/img/i-form-comment-ios.svg
new file:   sipevents/static/img/i-form-comment-material.svg
new file:   sipevents/static/img/i-form-email-ios.svg
new file:   sipevents/static/img/i-form-email-material.svg
new file:   sipevents/static/img/i-form-gender-ios.svg
new file:   sipevents/static/img/i-form-gender-material.svg
new file:   sipevents/static/img/i-form-name-ios.svg
new file:   sipevents/static/img/i-form-name-material.svg
new file:   sipevents/static/img/i-form-password-ios.svg
new file:   sipevents/static/img/i-form-password-material.svg
new file:   sipevents/static/img/i-form-settings-ios.svg
new file:   sipevents/static/img/i-form-settings-material.svg
new file:   sipevents/static/img/i-form-tel-ios.svg
new file:   sipevents/static/img/i-form-tel-material.svg
new file:   sipevents/static/img/i-form-toggle-ios.svg
new file:   sipevents/static/img/i-form-toggle-material.svg
new file:   sipevents/static/img/i-form-url-ios.svg
new file:   sipevents/static/img/i-form-url-material.svg
new file:   sipevents/static/js/datetimepicker/jquery.datetimepicker.full.js
new file:   sipevents/static/js/datetimepicker/jquery.datetimepicker.full.min.js
new file:   sipevents/static/js/datetimepicker/jquery.datetimepicker.js
new file:   sipevents/static/js/datetimepicker/jquery.js
new file:   sipevents/static/js/framework7.js
new file:   sipevents/static/js/framework7.js.map
new file:   sipevents/static/js/framework7.min.js
new file:   sipevents/static/js/framework7.min.js.map
new file:   sipevents/static/js/my-app.js
new file:   sipevents/templates/creatEvent.html
new file:   sipevents/templates/index.html
new file:   sipevents/templates/showEvent.html
new file:   sipevents/views.py
Changes not staged for commit:
  (use "git add <file>…" to update what will be committed)
  (use "git checkout — <file>…" to discard changes in working directory)
modified:   .gitignore

结果,好像弄错了一个:

flask文件夹,也是不需要加入的。。。

[已解决]删除已经git add了但是还没有push提交的文件夹

然后就可以去提交了:

➜  sipevents git:(master) git commit -m "initial version. has implemented most functions for sipvents."
[master 828a321] initial version. has implemented most functions for sipvents.
 69 files changed, 47749 insertions(+)
 create mode 100644 config.py
 create mode 100644 db_create.py
 create mode 100644 db_manager.py
 create mode 100644 instance/config.py
 create mode 100644 run.py
 create mode 100644 sipevents/__init__.py
 create mode 100644 sipevents/forms.py
 create mode 100644 sipevents/models.py
 create mode 100644 sipevents/static/css/datetimepicker/jquery.datetimepicker.css
 create mode 100644 sipevents/static/css/datetimepicker/jquery.datetimepicker.min.css
 create mode 100644 sipevents/static/css/framework7.ios.colors.css
 create mode 100644 sipevents/static/css/framework7.ios.colors.min.css
 create mode 100644 sipevents/static/css/framework7.ios.css
 create mode 100644 sipevents/static/css/framework7.ios.min.css
 create mode 100644 sipevents/static/css/framework7.ios.rtl.css
 create mode 100644 sipevents/static/css/framework7.ios.rtl.min.css
 create mode 100644 sipevents/static/css/framework7.material.colors.css
 create mode 100644 sipevents/static/css/framework7.material.colors.min.css
 create mode 100644 sipevents/static/css/framework7.material.css
 create mode 100644 sipevents/static/css/framework7.material.min.css
 create mode 100644 sipevents/static/css/framework7.material.rtl.css
 create mode 100644 sipevents/static/css/framework7.material.rtl.min.css
 create mode 100644 sipevents/static/css/my-app.css
 create mode 100644 sipevents/static/img/avatar/limao.jpg
 create mode 100644 sipevents/static/img/avatar/liyuanfei.jpg
 create mode 100644 sipevents/static/img/avatar/navi_add_lightblue_24x24.svg
 create mode 100644 sipevents/static/img/avatar/oswjmv02FBc16eCjUsJY3tOEj_wo.png
 create mode 100644 sipevents/static/img/avatar/oswjmv4X0cCXcfkIwjoDfCkeTVVY.png
 create mode 100644 sipevents/static/img/avatar/oswjmv6AxX5vOgtlsYL8qiPFyB1Q.png
 create mode 100644 sipevents/static/img/avatar/oswjmv7kEyDhFfYLQCbJHTlnXdow.png
 create mode 100644 sipevents/static/img/avatar/oswjmvw7lf73HT53QHOWwl4-pKr8.png
 create mode 100644 sipevents/static/img/avatar/wutao.jpg
 create mode 100644 sipevents/static/img/avatar/zhangbinglian.jpg
 create mode 100644 sipevents/static/img/avatar/zhouhaixiao.jpg
 create mode 100644 sipevents/static/img/i-f7-ios.png
 create mode 100644 sipevents/static/img/i-f7-material.png
 create mode 100644 sipevents/static/img/i-form-calendar-ios.svg
 create mode 100644 sipevents/static/img/i-form-calendar-material.svg
 create mode 100644 sipevents/static/img/i-form-comment-ios.svg
 create mode 100644 sipevents/static/img/i-form-comment-material.svg
 create mode 100644 sipevents/static/img/i-form-email-ios.svg
 create mode 100644 sipevents/static/img/i-form-email-material.svg
 create mode 100644 sipevents/static/img/i-form-gender-ios.svg
 create mode 100644 sipevents/static/img/i-form-gender-material.svg
 create mode 100644 sipevents/static/img/i-form-name-ios.svg
 create mode 100644 sipevents/static/img/i-form-name-material.svg
 create mode 100644 sipevents/static/img/i-form-password-ios.svg
 create mode 100644 sipevents/static/img/i-form-password-material.svg
 create mode 100644 sipevents/static/img/i-form-settings-ios.svg
 create mode 100644 sipevents/static/img/i-form-settings-material.svg
 create mode 100644 sipevents/static/img/i-form-tel-ios.svg
 create mode 100644 sipevents/static/img/i-form-tel-material.svg
 create mode 100644 sipevents/static/img/i-form-toggle-ios.svg
 create mode 100644 sipevents/static/img/i-form-toggle-material.svg
 create mode 100644 sipevents/static/img/i-form-url-ios.svg
 create mode 100644 sipevents/static/img/i-form-url-material.svg
 create mode 100644 sipevents/static/js/datetimepicker/jquery.datetimepicker.full.js
 create mode 100644 sipevents/static/js/datetimepicker/jquery.datetimepicker.full.min.js
 create mode 100644 sipevents/static/js/datetimepicker/jquery.datetimepicker.js
 create mode 100644 sipevents/static/js/datetimepicker/jquery.js
 create mode 100644 sipevents/static/js/framework7.js
 create mode 100644 sipevents/static/js/framework7.js.map
 create mode 100644 sipevents/static/js/framework7.min.js
 create mode 100644 sipevents/static/js/framework7.min.js.map
 create mode 100644 sipevents/static/js/my-app.js
 create mode 100644 sipevents/templates/creatEvent.html
 create mode 100644 sipevents/templates/index.html
 create mode 100644 sipevents/templates/showEvent.html
 create mode 100644 sipevents/views.py
➜  sipevents git:(master) git push
Counting objects: 81, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (79/79), done.
Writing objects: 100% (81/81), 976.07 KiB | 0 bytes/s, done.
Total 81 (delta 15), reused 0 (delta 0)
   24c0dc2..828a321  master -> master

然后去网站上看看:

就可以了。

转载请注明:在路上 » [记录]通过git命令行把已有的PyCharm项目代码上传到OSChina的git上

发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
83 queries in 0.178 seconds, using 22.16MB memory