git clone https://github.com/longcw/MOTDT.git
cd MOTDT/
git status # 查看状态
# master # 在master分支
git log # 查找历史版本sha值
# commit e8d96c4319d3525375707b73f70d5ffbbc056945 (HEAD -> oldversion)
# Merge: 9499c1e 41b29f5
# Author: longc-ubuntu <[email protected] >
# Date: Thu Sep 27 16:01:27 2018 +0800
#
# Merge branch 'master' of github.com:longcw/MOTDT
#
# commit 9499c1e7f25b753a077443936351aebdd6100b12
# Author: longc-ubuntu <[email protected] >
# Date: Thu Sep 27 16:00:32 2018 +0800
#
# update for torch 0.4
#
# (git branch 新分支名 SHA值)
git branch oldversion e8d96c4319d3525375707b73f70d5ffbbc056945
# (git checkout 新分支名)
git checkout oldversion (这里代码已经切换为新分支的历史版本)
git branch --list
# master
# * oldversion
绑定本地文件夹至 github 新repository
cd codefolder/
git init
git remote add origin https://github.com/xxxxxx.git
git pull origin master #
git config --global user.email "[email protected] "
git add ./*.py # add files
git commit -m "first coooo" # 需要账号密码
git push origin master # 上传
已经克隆github repo到本地后:更新本地修改
git status # 查看状态
#On branch master
#Your branch is up to date with 'origin/master'.
git add ./* # 添加本地修改后需要更新的文件
git commit -m 'add project' # 确认修改并添加说明
git push origin master # 上传修改