赞
踩
git checkout -b new_local_branch
git add
git commit -m "XXXX"
git push origin new_local_branch:new_remote_branch
origin是远程主机名,后面先是之前新建的本地分支名,后跟一个:,最后是新的远程分支名。
这一步有简略写法。
git push -u origin new_branch
-u 是–set-upstream的缩写形式,origin是远程主机名, new_branch为新建的远程分支,这里新建的远程分支名需要与本地分支名相同。
git checkout -b new_local_branch origin/remote_branch
git branch -m new_branch_name
git push origin -d old_remote_branch
再将新的本地分支提交到新的远程分支
git push origin -u new_branch_name
git branch -vv
git branch -d local_branch
git push origin -d remote_branch
git reset --mixed
–mixed 指清空stage/cache/index区域
git reset new_file
git rm --cached new_file
可以去除add进缓存区的文件new_file,并且不删除物理文件.
而
git rm -f new_file
则是既删除缓存区new_file,也会将new_file的物理文件删除
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。