GIT 使用指南

Git Proxy:设置代理

git config --global http.proxy 代理地址

 

Repository clone

git clone git地址

git checkout branchName

 

工作流程:

1.为一个feature新建一个branch在它上面进行开发, 最好在远程repository上直接创建 -- 本地创建要选择基于哪个branch

2.add 这些改动到stage -- sourceTree里选中就直接添加文件到stage

3.暂存修改git stash

4.切换回主分支更新代码 git checkout develop, git pull

5.切回工作分支merge最新代码 git checkout aa, git merge develop

6.commit them to local branch — commit -m “message”

7.push this branch to remote repository — 远程创建的分支用git push  本地建的分支用git push origin TEST-142:fix/TEST-142

5.raise a merge request on gitlab to merge the new branch to develop

 

git 架构

git会有两个仓库,一个是remote repository,一个是local repository

git的三个区域:

remote repo  ---------------  local repo ----------------- local work area

git fetch remote repo local repo

git pull remote repo 拉到 local repo local work area.

git branch -d xxx  删除本地分支

git branch -D xxx 强制删除本地分支

git branch -a 查看本地和远程所有分支

git branch 查看本地分支

git stash 保存unstaged 临时修改的文件

git stash apply 恢复stash的文件

git merge xxx xxx分支merge到当前分支

原文地址:https://www.cnblogs.com/IcanFixIt/p/5109084.html