Git默认用户名和密码设置
摘要:git bash进入你的项目目录,输入:git config --global credential.helper store然后你会在你本地生成一个文本,上边记录你的账号和密码。当然这些你可以不用关心。然后你使用上述的命令配置好之后,再操作一次git pull,然后它会提示你输入账号密码,第一次输
阅读全文
git 开发功能分支标准流程
摘要:git clone xxxxxxx.git git checkout -b feature-A develop git add feature-A git commit -m "add feature A" git checkout develop git pull origin develop git checkout feature-A git rebas...
阅读全文
reset 单个文件 回退
摘要:git将单个文件恢复到历史版本的正确方法如下: git reset commit_id 文件路径 git checkout -- 文件路径
阅读全文
Git: untrack a file in local repo only and keep it in the remote repo
摘要:You could update your index: and make sure it never shows as "updated" in your current repo.That means it won't ever been pushed, but it is still pres
阅读全文
delete all untracked files
摘要:f file d directory x .gitignore
阅读全文
git 解决冲突
摘要:push失败,版本落后,提示要fetch 发生冲突 选择修改,解决冲突 提交处理后的文件,再push
阅读全文
git rm –cached filename
摘要:为了能重新忽略那些已经被track的文件,例如停止tracking一个文件但是又不从仓库中删除它。可以使用以下命令: 代码如下 git rm –cached filename 上面这个命令用于删除单个缓存文件。删除缓存目录使用以下命令: 代码如下 git rm -rf –cached foldername 如果你想忽略的文件或者文件夹比较多,无法一个一个的...
阅读全文
push to deploy
摘要:1.server端 建立裸仓 脚本 ***复制仓库,如果是已有代码的,直接从server代码处git clone到本地来,跳过下步 2.client端 已经好了,使用时直接push同步到server,如下: 来源:https://ma.ttias.be/simple-git-push-workflo
阅读全文
git error
摘要:1.git push 报错 [remote rejected] master -> master (branch is currently checkedout) error: failed to push some refs ..
阅读全文
git 强制覆盖本地
摘要:$ git fetch downloads the latest from remote without trying to merge or rebase anything. Then the $git reset resets the master branch to what you just
阅读全文
.gitignore 配置
摘要:.gitignore 配置文件用于配置不需要加入版本管理的文件,配置好该文件可以为我们的版本管理带来很大的便利,以下是个人对于配置 .gitignore 的一些心得。 1、配置语法: 以斜杠“/”开头表示目录; 以星号“*”通配多个字符; 以问号“?”通配单个字符 以方括号“[]”包含单个字符的匹配
阅读全文
Git fetch和git pull的区别
摘要:原文: http://www.tech126.com/git-fetch-pull/ git fetch origin mastergit log -p master..origin/mastergit merge origin/master git fetch origin master:tmpg
阅读全文
git commands
摘要:添加远程仓库 提交 删除分支 保存用户名密码 提交远程分支 一旦远程主机的版本库有了更新(Git术语叫做commit),需要将这些更新取回本地,这时就要用到git fetch命令。 上面命令将某个远程主机的更新,全部取回本地。 默认情况下,git fetch取回所有分支(branch)的更新。如果只
阅读全文