解决 Git For Windows 无法提交
2015-04-15 12:33
323 查看
原文 http://mawenjian.net/p/1157.html
最近因为需要使用Git管理代码,所以向来对Git不甚感冒的我,也不得不学习使用Git了。要用Git管理代码,Git客户端自然必不可少,可上网一搜,Windows下的Git客户端软件还真不多——Github
for Windows,TortoiseGit和SmartGit。
鉴于Github for Windows是Github官方出的,所以我就选择了这个。我记得第一次使用Github
for Windows时,我一看还得这货还得登陆Github账户,便误以为只能管理Github库,便就立刻卸载掉了。到了今天我才知道,原来这货也可以管理其他Git库……
Github for Windows添加库十分简单,以京东代码库为例,只要选中“代码库首页”的URL(如https://code.jd.com/mawenjian/jae_appname),将其拖入Github for Windows窗口,待下面显示“drop anywhere to clone”松手即可。而后,输入用户名和密码,就开始导入代码了。
官方说明如下:
You can add any repository already on your hard drive by dragging a folder in from Explorer. If that folder is a Git repository, GitHub for Windows will import all of the history and connect it to your GitHub accounts.
至于提交代码,也很简单,待修改完成后添加注释,再选择“Commit”提交即可。不过我第一次提交代码时,GfW竟然提示“Commit failed:Failed to create a new commit”错误,我还以为这货有BUG呢。
好在我从StackOverflow找到了解决方案:
1.打开PowerShell窗口,输入 “git add [file name]” 命令提交文件;
2.输入”git status”命令,查看那些文件被提交,其中绿色标记是提交成功的,红色标记是没有提交成功的;
3.当所有文件都被提交后,输入”git commit”命令。
到了这里,我遇到的问题提示是没有配置用户名和邮箱(大概这个意思)。然后我按照提示配置好用户名和邮箱,再提交代码就没有问题了。
StackOverflow英文解释如下:
Try opening up PowerShell and manually committing each file using the “git add [file name]” command. To see which files have been committed, enter “git status” into the command line. The green files have been committed, the red ones uncommitted.
Once you’ve committed them all, type “git commit.” Then go back to Github for Windows and sync it up.
I’m not sure what causes this issue, but once I followed the above steps, Github went back to its normal, awesome behavior.
最近因为需要使用Git管理代码,所以向来对Git不甚感冒的我,也不得不学习使用Git了。要用Git管理代码,Git客户端自然必不可少,可上网一搜,Windows下的Git客户端软件还真不多——Github
for Windows,TortoiseGit和SmartGit。
鉴于Github for Windows是Github官方出的,所以我就选择了这个。我记得第一次使用Github
for Windows时,我一看还得这货还得登陆Github账户,便误以为只能管理Github库,便就立刻卸载掉了。到了今天我才知道,原来这货也可以管理其他Git库……
Github for Windows添加库十分简单,以京东代码库为例,只要选中“代码库首页”的URL(如https://code.jd.com/mawenjian/jae_appname),将其拖入Github for Windows窗口,待下面显示“drop anywhere to clone”松手即可。而后,输入用户名和密码,就开始导入代码了。
官方说明如下:
You can add any repository already on your hard drive by dragging a folder in from Explorer. If that folder is a Git repository, GitHub for Windows will import all of the history and connect it to your GitHub accounts.
至于提交代码,也很简单,待修改完成后添加注释,再选择“Commit”提交即可。不过我第一次提交代码时,GfW竟然提示“Commit failed:Failed to create a new commit”错误,我还以为这货有BUG呢。
好在我从StackOverflow找到了解决方案:
1.打开PowerShell窗口,输入 “git add [file name]” 命令提交文件;
2.输入”git status”命令,查看那些文件被提交,其中绿色标记是提交成功的,红色标记是没有提交成功的;
3.当所有文件都被提交后,输入”git commit”命令。
到了这里,我遇到的问题提示是没有配置用户名和邮箱(大概这个意思)。然后我按照提示配置好用户名和邮箱,再提交代码就没有问题了。
StackOverflow英文解释如下:
Try opening up PowerShell and manually committing each file using the “git add [file name]” command. To see which files have been committed, enter “git status” into the command line. The green files have been committed, the red ones uncommitted.
Once you’ve committed them all, type “git commit.” Then go back to Github for Windows and sync it up.
I’m not sure what causes this issue, but once I followed the above steps, Github went back to its normal, awesome behavior.
相关文章推荐
- 解决git for windows无法commit
- git for windows 无法提交修改的处理
- 解决android studio 中SVN和git冲突 无法提交代码
- 针对Github的Git工具快速配置——当Github for windows无法下载时。。。
- 解决windows下使用vc-git提交中文注释乱码的问题
- 解决关于Git无法提交 index.lock File exists的问题
- 关于Git无法提交 index.lock的解决办法
- an error occurred attempting install_Github_for_windows_无法安装的解决方法_
- git在本地创建的仓库无法提交到远程仓库解决办法
- 关于Git无法提交 index.lock的解决办法
- Git for windows无法使用
- git提交过程中遇到的 index.lock 问题导致无法提交的解决方法
- 解决安装Docker CE for Windows之后VirtualBox无法启动虚拟机的问题
- 解决Git在添加ignore文件之前就提交了项目无法再过滤问题
- git for windows 无法结束node进程(windows下杀进程)
- g4e常见问题#1 解决Git在Windows上使用http/https无法认证的问题
- 解决 Windows 环境 Git Bash 无法识别 Composer 命令的问题
- windows Git Bash 无法运行python文件的解决方法
- 关于github for windows无法登陆,login failed问题的解决方法
- 关于Git无法提交 index.lock的解决办法