使用git提交代码简单说明
一. 图形化git

git add . #将任何新的或修改的文件添加到索引
git commit -m '注释信息 ' #提交 git push origin master
git rm -r --cached test
git commit -m "Remove the ignored directory test"
git push -u origin master
五. 如果想把代码提交到和之前不同的仓库中
例如有远端仓库pshyms/django,它的克隆地址https://github.com/xxx/django.git。需求是把本地dailyfresh文件夹上传到xxx/django远端仓库中
1. 在本地仓库位置比如/root/mygithub中执行git clone https://github.com/xxx/django.git
2. 把dailyfresh文件夹放到克隆下来的django文件夹下
3. 在django文件夹下执行git add . git commit -m ' .." git push origin master
git mv -f oldfolder newfolder
git add -u newfolder (-u选项会更新已经追踪的文件和文件夹)
git commit -m "changed the foldername whaddup"
git push origin master 七. 删除文件夹
git rm -r folder
git commit -m "delete"
git push origin master 八. 新建/删除分支
git branch new_branch #新建一个分支
git checkout new_branch #切换到新的分支名
git branch #查看一下分支情况
git push -u origin new_branch #将新分支同步到github线上
然后就是git add . git push 老路子了 如果想删除new_branch分支,首先切换到不是要删除的分支,比如git checkout master, 然后git branch -d new_branch 即可 九. pycharm上传项目到github 链接:https://blog.csdn.net/m0_37306360/article/details/79322947需要先配置好git的相关参数,比如ssh密钥和全局环境变量
使用git提交代码简单说明的更多相关文章
- Git使用、Git配置、Git提交代码、Git上传
非教程,只是自己的一个简单笔记.建议没有入门的朋友,直接看git的官方help文档: https://help.github.com/articles/set-up-git 1.注册一个git账号,超 ...
- Git提交代码到主分区
git 提交代码,本地新建一个my分支,不从本地master分支直接上传,而是先从本地my分支上提交至本地master分支,然后本地master提交至远程master分支 上.前提是远程只有一个mas ...
- git提交代码到github
前言:转载请注明出处:http://blog.csdn.net/hejjunlin/article/details/52117504 git提交代码到github 命令汇总: git init git ...
- 使用git提交代码到github,每次都要输入用户名和密码的解决方法
自从使用git提交代码到github后,发现自己使用git的功力增长了不少,但也遇到不少问题.比如,使用git提交代码到github的时候,经常要求输入用户名和密码,类似这种: 网上有这么一种解决方法 ...
- Git提交代码失败: empty ident name (for <>) not allowed
使用git提交代码,报错如下: 下午2:56 Commit failed with error 0 files committed, 1 file failed to commit: 升级 empty ...
- 在使用Git提交代码的时候犯了个低级错误
今天在使用git提交代码的时候,犯了个很低级的错误,按照一切流程当我add并commit提交代码,最后使用push到远程仓库, 接下来奇怪的事情发生了,push之后,查看远程仓库代码并没有发现提交记录 ...
- Git提交代码报错Git push error:src refspec XXX matches more than one解决方案
Git提交代码push时,报错这个 error: src refspec master matches more than one. error: failed to push some refs t ...
- git提交代码到码云
日常代码一般提交到github比较多,但我还是钟爱马爸爸,没错就是码云. 码云是中文版的代码托管的网站,不存在打开网速问题,使用也蛮方便的,日常自己保存托管代码已经足够,平时使用git提交代码到码云是 ...
- git提交代码报错 trailing whitespace的解决方法
1. git提交代码报错 trailing whitespace 禁止执行pre-commit脚本 进入到项目目录中 chmod a-x .git/hooks/pre-commit 2.git提交代码 ...
随机推荐
- android用户登录验证
转自https://www.cnblogs.com/android-blogs/p/5912585.html
- XHTML的规范化
-------------------siwuxie095 XHTML 简介 1.什么是 XHTML? XHTM ...
- 无需写try/catch,也能正常处理异常
对于企业应用的开发者来说,异常处理是一件既简单又复杂的事情.说其简单,是因为相关的编程无外乎try/catch/finally+throw而已:说其复杂,是因为我们往往很难按照我们真正需要的策略来处理 ...
- HTTP/2协议
一.简介 http://toutiao.com/a6258917202906104066/
- [SoapUI] SOAP UI-Groovy Useful Commands
Hi All, I have posted the SOAPUI and Groovy useful commands that may help you in your testing. Below ...
- SourceTree 3.0.8 跳过登陆注册
3.0.8普通用户版account.json跳过登陆注册方法已失效,请安装企业版 https://www.sourcetreeapp.com/enterprise 企业版默认安装在 %programf ...
- 通过MySql自动同步刷新redis
在服务端开发过程中,一般会使用MySQL等关系型数据库作为最终的存储引擎,Redis其实也可以作为一种键值对型的数据库,但在一些实际场景中,特别是关系型结构并不适合使用Redis直接作为数据库.这俩家 ...
- Android编程设置LayoutParams
RelativeLayout.LayoutParams linearParams = (RelativeLayout.LayoutParams)viewHolder.headerWraper.getL ...
- 编写高质量代码改善C#程序的157个建议——建议76: 警惕线程的优先级
建议76: 警惕线程的优先级 线程在C#中有5个优先级:Highest.AboveNormal.Normal.BelowNormal和Lowest.讲到线程的优先级,就会涉及线程的调度.Windows ...
- CodeForces 47E. Cannon(离线暴力+数学)
E. Cannon time limit per test 3 seconds memory limit per test 256 megabytes input standard input out ...