abigyjj

git bash 常用指令

0
阅读(2071)

常用的git bash 的指令:


git1. 进入git目录
    2  cd f:
    3  ls
    4  cd gitextension/
    5  ls

2. 新建目录
    6  mkdir git_repo
    7  cd git_repo/

3. clone master代码
   23  git clone http://xxx.xxx.x.xxx/xxx/xxxx.git

3. 新建branch
   30  git checkout -b sandbox/XXX

4. 查看branch
   31  git branch
   32  git branch --all

5. 切换到其他branch
   33  git checkout master
   34  git checkout sandbox/XXX
   36  git checkout sandbox/XXX

6. 查看状态
   37  git status

7. 将新建branch上传到git server
   38  git push origin sandbox/yangjj:sandbox/yangjj


8. 提交修改
   39  git status
   40  git commit -m "git test"
   44  git push
   45  git status

9. 提交新建文件
   46  git add --all
   47  git status
   48  git commit -a -m "test"
   49  git status
   50  git push

10 提交所有修改  //当前地址要切换过来

   46  git add --all
   47  git status
   48  git commit -a -m --all
   49  git status
   50  git push