Day 5 20190120 老男孩python学习第5天 内容整理

今天继续看Mastering Pycharm的视频,一个半小时

 

看git的教学视频:  视频1小时44分钟,看了2个半小时以上

https://www.youtube.com/watch?v=xuB1Id2Wxak

 

安装好git,在github上注册好账户,创建好repository,

 

在想要pull到的文件夹右键“Git Bash here”,输入命令"git init"就会自动生成一个.git的文件夹,以后这里就是pull的地址

 

然后就需要将这个文件夹和你github的云端文件夹关联起来,输入:

 

git remote add origin "云端的URL地址,可以直接从github复制",回车

 

继续输入:

 

git pull origin master

回车

就会连接上github,你需要输入自己的github用户名和密码,就会自动完成pull的动作,这样云端的文件就被pull到本地了

 

git status

如果显示有untracked files,就是新的文件,还没有被加入到Git的index里面,如果不加入,就不会被上传至github

 

git add filename 是添加单独一个file

git add -A 是全部添加

 添加完毕以后可以执行commit

 

git commit -m "first commit"

是commit,后面双引号的东西是说明,不写的话github也会自己添加,m代表message

git是区分大小写命令的,大小写不正确会报错

git commit -a 这里是小写的a,不同于add命令,注意

 

git log可以看日志

 

git branch firstbranch 创建一个新的副本branch供人修改

git checkout firstbranch 就从master branch跳到了firstbranch

 

修改文档后再add和commit into firstbranch,

ls 命令就是list

 

Merging就是把不同的branch合并到一起,原来branch里面的东西还在,在merge以后,修改branch的东西,需要再一次merge才会再一次更新,不然就是可以自由在branch修改而不影响合并后的文件

 

git merge 起点 终点,  git 1 2 means  git  1 to 2, 2 is the terminal station

 

修改了东西之后,git commit -a -m "modified" 会自动把修改后的文档先add,然后commit,如果是从branch commit,那就只会修改branch的文档,除非再次merge,不然master文档不会改变

cat xxx.txt 显示文档内容

 

git pull = git fetch(会在单独一个branch) + git merge

 

rebasing 将branch的更新放在master的末端,可以保持update history clear

在firstbranch目录下,输入 git rebase master,就会把master里面的文档复制过来,同样,如果在master目录下,做git rebase firstbranch,就会把firstbranch里面的文档复制到master里面

 

git pull = git fetch + git merge;

git pull /r = git fetch + git rebase;

 

 

最后一步,git push,先要获得key的允许,才能进行push,通过ssh key

首先, ssh-keygen,生成ssh key,

cat 路径来打开key,并复制key码,

回到github,settings,deploy keys,添加key,暂时是灰色,

输入ssh -T git@github.com(这里与视频有出入,但是还是上传成功了)应该是我用的private没用public的原因

连接成功后,跳回到firstbranch,再输入

git push origin firstbranch

成功后,

github端就会多一个firstbranch,新传的。

 

如果要改master,就git checkout master,切回到master

然后输入

git push origin master

 

 

剩余,reverse 即 go back,

 

git log(按q退出) ,复制哈希copy hash

 

git checkout 哈希码前八位即可 文件名  

git checkout 2dsd32f1 reverse.txt

 

 

 

转载于:https://www.cnblogs.com/Jack1314/p/10295159.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
PyCharm is addictive, with powerful and configurable code completion, superb editing tools, top-notch support, diverse plugins, and a vibrant ecosystem to boot. Learning how PyCharm works and maximising the synergy of its powerful tools will help you to rapidly develop applications. From leveraging the power of the editor to understanding PyCharm’s internals, this book will give you a comprehensive view of PyCharm and allow you to make your own choices about which workflow and tools are best for you. You will start by getting comfortable with PyCharm and making it look exactly like you want. You can customize the tools and taskbars to suit individual developers’ coding styles. You also learn how to assign keyboard shortcuts. You will master debugging by inserting breakpoints, collecting runtime data, and debugging from the console. You will understand how PyCharm works underneath and how plugins such as Codemap, Vim, Bitbucket, Assets compressor, markdown, bash file, shortcut translator, and .gitignore leverage the power of the IntelliJ platform. You will become comfortable using the VCS interface in PyCharm and see the benefits of using it for some simple tasks as well as some more complex tasks such as partial commits using changelists. You will take an in-depth look at the various tools in PyCharm, improving your workflow drastically. Finally, you will deploy powerful PyCharm tools for Django, Flask, GAE, and Pyramid Development, becoming well acquainted with PyCharm’s toolset for web development with popular platforms. Packed with insider tricks, this book will help you boost productivity with PyCharm. What You Will Learn Understand the internal workings of the IntelliJ Platform Leverage PyCharm’s powerful search tools, and learn which ones are the best for you and your workflow Customize PyCharm’s enhanced Python interpreter and its inbuilt terminal Develop web applications quickly and easily with different frameworks such as Flask and Django Understand
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值