2. push之前提交的历史注释
git rebase -i head~3
表示要修改当前版本的倒数第三次状态,这个命令出来之后,会出来三行东东:
pick f9173fc Fix wrong name 'path_filename'
pick 3fddde0 Change versiton to 0.2: Add share option
pick 5962845 Change platform section name from [arch-platform-name] to [name:platform]
...
如果你要修改哪个,就把那行的pick改成edit,然后保存退出,这时候会提示
Stopped at 4c85552... Change versiton to 0.2: Add share option
You can amend the commit now, with
git commit --amend
Once you are satisfied with your changes, run
git rebase --continue
按照提示进行修改即可。
3. push 之后,已经存放到远程服务器上的修改
如果push之后,那么也可以按照上面的方法进行修改,只是提交的时候需要使用 -f 强制提交
git push -f origin master
$ git add text/text1.txt$ git commit -m "text1"
$ git add text/text2.txt
$ git commit -m "text2"
$ git push origin master
单独add 单独commit测试可行。其他方法不清楚。但是外部文件夹的message会是最后一次commit提交的message。
1、下载最新版本的githttp://git-scm.com/downloads
当你安装完成git的时候,你需要简单的配置一下,打开终端:
2、第一步,你需要告诉git你的名字与email,这个名字会出现在你的提交记录中。
git
config
--global
user.name
"你的名字"
git
config
--global
user.email
"你的Email"
3、创建本地仓库
使用
git-gui
图形界面创建一个仓库:
4、编写帮助文件touch
README.md
(创建帮助文件)git
add
README.md
(添加帮助文件)git
commit
-m
"注释内容”
(添加注释)
5、连接远程仓库git
remote
add
origin
https://git.oschina.net/username/cccc.git
(你的远程仓库地址地址)
6、上传代码到码云把你要上传的文件拷贝到
repo
文件夹下;使用
git
push
-u
origin
master
上传文件到码云
ps:push
之前,最好要
pull
一次;init
之后,记得要进行一次
add
和
commit
*** 作;若报这样的错误,请使用
git
push
-u
origin
master
-f
强制push;刷新码云项目页面,若只传了
README.md
文件,请进行如下 *** 作:
a.
git
add
.
(添加目录下所有项目,add与
.
之间有空格)
b.
git
commit
-m
“添加注释信息"
(添加注释信息)
c.
git
push
-u
origin
master
(再去
push
要上传的文件)
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)