阿左的小站 2020-06-17
You have an empty repository
To get started you will need to run these commands in your terminal.
New to Git? Learn the basic Git commands
Configure Git for the first time
git config --global user.name "xxxx"
git config --global user.email "xxxxxxxx"
Working with your repository
I just want to clone this repository
If you want to simply clone this empty repository then run this command in your terminal.
git clone http://git.syzl.com/scm/~wangcq/sms.git
My code is ready to be pushed
If you already have code ready to be pushed to this repository then run this in your terminal.
cd existing-project
git init
git add --all
git commit -m "Initial Commit"
git remote add origin http://git.syzl.com/scm/xxxxxxxxxq/sms.git
git push -u origin master
My code is already tracked by Git
If your code is already tracked by Git then set this repository as your "origin" to push to.
cd existing-project
git remote set-url origin http://git.syzl.com/scm/~xxxxxxxxxxx/sms.git
git push -u origin --all
git push origin --tags
第一种方法:(简单易懂)
1、git add .(后面有一个点,意思是将你本地所有修改了的文件添加到暂存区)
2、git commit -m""(引号里面是你的介绍,就是你的这次的提交是什么内容,便于你以后查看,这个是将索引的当前内容与描述更改的用户和日志消息一起存储在新的提交中)
3、git pull origin master 这是下拉代码,将远程最新的代码先跟你本地的代码合并一下,如果确定远程没有更新,可以不用这个,最好是每次都执行以下,完成之后打开代码查看有没有冲突,并解决,如果有冲突解决完成以后再次执行1跟2的操作
4、git push origin master 将代码推至远程就可以了