linux下git安装配置及使用

版权声明:AdeCary https://blog.csdn.net/xingjidemimi/article/details/83444679

环境:ubuntu 16.04.05

git安装(ubuntu)

sudo apt-get install git

git使用

第一次使用git库需要使用git clone ‘远端地址’,将代码克隆到本地

设置全局的邮件和用户名

git config --global user.email "自己的邮箱地址"

git config --global user.name "自己起的名字"

在含有.git的文件目录内创建、修改、删除自己的开发文件,此文件即为开发目录

在进行提交文件之前先git pull或git pull --rebase远端版本库,同步文件

增加 git add .

添加文档的备注 git commit -m '备注'

提交文档 git push origin master

当提交后发现有版本需要同步,使用git pull然后再git push origin master即可

查看当前git分支 git branch

查看分支列表 git branch -r

创建ubuntu分支 git checkout -b ubuntu

回退版本 git checkout master

合并到当前分支 git merge ubuntu版本向前推进

pycharm中使用git

选择vcs>>checkout from>>git填写远端git地址,并选择路径,

进入后,更改自己的项目后需要vcs>>git>>commit>>然后merge>>push

更新库使用vcs>>git>>pull

创建分支

项目上右键git>>respo>>branch

里程碑tag

找到branch>>checkout

reset head恢复上一个版本

猜你喜欢

转载自blog.csdn.net/xingjidemimi/article/details/83444679