1.git提交代码步骤

git status

git stash

git pull

git stash apply

git add .

git commit -m "u"

git push origin master

2.git clone 文件git地址(远程clone一份文件)

3.git忽略规则及.gitignore规则不生效的解决办法

在文件根目录下执行touch .gitignore
编写.gitignore
将要忽略的文件目录写到该文件中
node_modules/
src/main/webapp/bower_components/
一般文件受git版本控制之后,如果要修改.gitignore添加要忽略的文件,
(想把某些目录或文件加入忽略规则)会发现gitignore未生效,
原因是.gitignore只能忽略那些原来没有被track的文件,如果某些文件已经被纳入了版本管理中,
则修改.gitignore是无效的。那么解决方法就是先把本地缓存删除(改变成未track状态),然后再提交

git rm -rf --cached .
git add .
git commit -m "update .gitignore"
git push origin master


rm -rf .git
git init
git remote add origin 地址
git push -f -u origin master



git reset--mixed(git提交错误,stash时提示merge。
fatal: git-write-tree: error building trees
Cannot save the current index state)
http://stackoverflow.com/questions/5483213/fatal-git-write-tree-error-building-trees

推荐博客:http://www.cnblogs.com/ys-ys/p/5493153.html

参考链接

http://www.cnblogs.com/wintersun/p/3930900.html

results matching ""

    No results matching ""