上传命令
第一步:
git remote add origin url //https://github.com/nodejs-team/evtGulp.git
第二步:
git add . //"."表示所有目录,也可跟目录名或文件名
第三步:
git commit -m "add src" //将目录提交到本地并加版本说明
第四步:
git push origin master //将目录提交到远程仓库
其它命令:
git pull origin master //将远程仓库拉取到本地
git remote set-url origin git@github.com:nodejs-team/evtGulp.git
git config --global user.name "Your Name"
git config --global user.email "email@example.com"
git rm fileName //移除文件
git rm -r folderName //移除文件夹
git修改远程仓库地址
方法有三种:
1.修改命令
git remote origin set-url [url]
2.先删后加
git remote rm origin
git remote add origin [url]
3.直接修改config文件
git pull origin master //pull会自动合并更新
git fetch origin master //fetch不会自动合并更新
创建.gitignore文件
1、在需要创建 .gitignore 文件的文件夹, 右键选择Git Bash 进入命令行,进入项目所在目录。
2、输入 touch .gitignore ,生成“.gitignore”文件。
3、在”.gitignore” 文件里输入你要忽略的文件夹及其文件就可以了。(注意格式)
我的 .gitignore:
.deploy_git/
node_modules/
public/
分支管理
参考地址:
https://www.cnblogs.com/shimily/articles/6374327.html
https://blog.youkuaiyun.com/weixin_36401046/article/details/52954408