Pk10网站建设多少钱,查看wordpress 插件,wordpress vul,西安百度推广公司1.建立本地仓库
查看当前项目根目录中有没有 .git文件#xff08;隐藏文件#xff09;#xff0c;如果没有#xff0c;右键-Git bash here #xff0c;然后输入命令git init建立本地仓库
git init
2.将代码提交到本地仓库
git add
git commit -m new branch…1.建立本地仓库
查看当前项目根目录中有没有 .git文件隐藏文件如果没有右键-Git bash here 然后输入命令git init建立本地仓库
git init
2.将代码提交到本地仓库
git add
git commit -m new branch commit
3.在本地仓库中建立一个与远程仓库的别名以便之后提交代码而不是每次都要输入远程仓库地址。指令结尾是git的仓库地址。
$ git remote add origin gitgithub.com:账户名/项目名.git
4.此时我要把本地的代码提交的远程仓库上步骤如下 1首先要建立本地的分支并切换到该分支上本地建立完分支默认是在master分支上
git branch hello_git_branch
git checkout hello_git_branch 2push到远程仓库上面
git push origin hello_git_branch
由于刚才我们为远程仓库起了一个别名那么这里就可以使用别名origin调用。
这里的含义是将hello_git_branch这个分支提交到远程仓库上面。如果远程仓库没有这个分支那么也会新建一个该分支。
当然也可以指定提交到远程仓库的某个分支上。 如下是将hello_git_branch分支提交到远程仓库的master上面
git push origin hello_git_branch:master
拓展
如果本地当前是在hello_git_branch分支上面此时想把远程仓库的master与我的hello_git_branch分支合并merge可以使用如下命令:
git pull origin hello_git_branch:master
如果您使用如下指令含义就是将远程仓库的master分支合并下来。如果本地没有master分支那么本地就新建一个master分支如果有这个分支就是 fetch merge 操作。
git pull master