1.新建一个需要使用git的目录

【git】本地仓库与远程仓库关联提交

2.  git init

进行 仓库初始化

【git】本地仓库与远程仓库关联提交

 3. git config

配置用户名密码

【git】本地仓库与远程仓库关联提交

4.简历远程仓库 ,不需要initialize

【git】本地仓库与远程仓库关联提交

5.git remote add origin 进行远程关联

【git】本地仓库与远程仓库关联提交

6.git add 

添加文件到master或者其他分支(需要切换到相应分支:git checkout dev):git add .   表示所有文件都进行添加

git commit

进行提交到分支

 【git】本地仓库与远程仓库关联提交

 7. git push -u origin master

推送到master分支

 【git】本地仓库与远程仓库关联提交

 

 在操作过程中可以使用git status进行状态查看,使用git log可以查看提交版本,建议新建分支进行测试版开发,master里基本为稳定版;

新建dev分支:git checkout -b dev

查看所有分支:git branch -a

 

相关文章: