git常用命令

1、查看配置

git config --list

 

2、远程代码拉到本地

  git clone git@code.ymmoa.com:changkang.cai/ymm-test-web.git

 

3、将暂存区中存放的文件提交到git仓库

git commit -m "tianruicai"

 

4、将本地代码库的当前分支推送到远程的代码库

git push -u origin tianruicai

 

5.切换到某个分支 

git checkout <branch_name>

查看当前分支

 git branch 

 

6、更新远程更新到本地:

先打开本地仓库的目录,要是程序文件夹的目录

然后输入更新代码命令,如下所示:

git pull 

7、提交代码

git add .
git commit -m “描述”
git push origin master
 
8、恢复当前版本,删除工作区和缓存区的修改
git reset --hard

 

 

 

 

 

1 git --version
2 git config --list
3 vim ~/.gitconfig
4 git config --global user.name"13564229364@163.com"
5 git config --global user.email 13564229364@163.com
6 git config --global user.name"tianruicai"
7 git config --list
8 git config user.name

10 git clone git@code.ymmoa.com:changkang.cai/ymm-test-web.git
11 git clone git@code.ymmoa.com:changkang.cai/ymm-test-web.git
12 ssh-keygen -t rsa -C "ruicai.tian@ymm56.com"
13 cd ~/.ssh
14 ssh-keygen -t rsa -C "ruicai.tian@ymm56.com"
15 cd ~/.ssh
16 git clone git@code.ymmoa.com:changkang.cai/ymm-test-web.git
17 git clone git@code.ymmoa.com:changkang.cai/ymm-test-web.git
18 git clone -o testweb git@code.ymmoa.com:jie.gu/ymm-test-web.git
19 git clone http://code.ymmoa.com/jie.gu/ymm-test-web.git
20 git config --list
21 vim ~/.gitconfig
22 git -version
23 git config --global user.email 13564229364@163.com
24 git config --list
25 vim ~/.gitconfig
26 U:#U:gi >E#>Egit =;#=; .D#.Dgit
27 git --version
28 git status
29 git add .
30 git commit -m "自动化接口"
31 git config --global user.name "ruicai.tian@ymm56.com"

32 git branch
33 pwd
34 git branch
35 git init
36 ls -ah
37 history

posted @ 2017-12-18 20:49  #甜甜8023  阅读(380)  评论(0编辑  收藏  举报