git常用命令

来源:互联网 发布:阿里云 共享计算型 编辑:程序博客网 时间:2024/06/05 02:29

GIT常用命令


git clone [address]:复制代码库到本地;
git add [file] ...:添加文件到代码库中;
git rm [file] ...:删除代码库的文件;
git commit -m [message]:提交更改,在修改了文件以后,使用这个命令提交修改。
git pull:从远程同步代码库到本地。
git push:推送代码到远程代码库。
git branch:查看当前分支。带*是当前分支。
git branch [branch-name]:新建一个分支。
git branch -d [branch-name]:删除一个分支。
git checkout [branch-name]:切换到指定分支。
git log:查看提交记录(即历史的 commit 记录)。
git status:当前修改的状态,是否修改了还没提交,或者那些文件未使用。
git reset [log]:恢复到历史版本。




ssh root@server

scp /opt/111.txt   root@server:/tmp/111.txt   把111.txt上传到远程服务器上

0 0
原创粉丝点击