Git Tutorial -idea series git tutorial

First, the new project

After the New Project remember to copy git address of the warehouse.

 

 

Second, upload the project to git repository

In your idea new in git repository, which is a new local repository, and so will be synchronized to the line git repository

 

If the new code is not the file name is not added to the green indicates no git index

 

You will need to upload the file as shown in the diagram add

 

After the addition, the file name will turn green

 

Then commit the project, submit a project, here is the first to submit with the local repository, then push to the online warehouse. Note here and svn is not the same.

Here we must choose commit and push. ( First filed with the local repository, then push to the online warehouse )

 

If the first submission of the project, here is no remote address. Click on the blue word, define the remote address. If submitted before then, there is a branch of information.

 

Enter just coding address warehouse copied, and then apply

 

Then we can see the remote branch information yet, the default is the master branch, if you want to submit to the other branch, click the master modification branch.

 

三、从git仓库检出项目

选择checkout

 

输入远程仓库地址,然后clone即可

 

四、更新项目、解决冲突

按照图片中的步骤,顺序不能乱,先stash,然后pull,最后unstash

 

stash会让你输入标记名称,unstash的时候选择想要的标记

 

如果代码有冲突,我们需要编辑冲突,我们一般选择merge,就是合并的意思,当然你也可以不合并直接使用线上的或者暂存里的代码。

 

合并代码的时候,图片中描述了,三屏分别对应的是什么。

 

五、切换git分支

右下角有个当前分支名称,点击会谈出一分支信息。如果你想切换分支,选中分支,点击右键checkout即可。

 

文章转载于腾讯云社区,如有侵权,请联系删除。

Guess you like

Origin www.cnblogs.com/Lyn4ever/p/10994093.html