git command

1.config

git config --global user.name xxx

git config --global user.email [email protected]

2.查看

git config --list

3.generate public-key

ssh-keygen -t rsa

将.ssh/id_rsa.pub 里的内容copy到server 设置里SSH Public Keys设定

4.clone

git clone ssh://account@gitserver:29418/projectName

5.查看远端分支

git branch -r

6.新建分支

git checkout -b newbranch remotebranch

6.push

git push ssh://account@server:29418/projectName HEAD:refs/for/branch

git push origin HEAD:refs/for/branch

7.将repo与本地branch关联起来

git config --add branch.loacalbranch.remote origin

git config -- add branch.localbranch.merge refs/heads/remotebranc

你可能感兴趣的:(command)