mac azure git

In the last article, Source Control using Git in Azure Data Studio (ADS), we explored the following topics:

在上一篇文章“ 在Azure Data Studio(ADS)中使用Git进行源代码控制”中 ,我们探讨了以下主题:

  • The requirement of Source control for SQL scripts SQL脚本的源代码管理要求
  • Git installation on Windows Windows上的Git安装
  • Integrate Git in Azure Data Studio 在Azure Data Studio中集成Git
  • Create Git repository, add SQL scripts, modify files, commit into source control 创建Git存储库,添加SQL脚本,修改文件,提交到源代码管理
  • View different versions using the Git timelines 使用Git时间线查看不同版本

In this article, we will take a step forward and integrate Git installed locally on the GitHub.

在本文中,我们将向前迈出一步,并集成在GitHub上本地安装的Git。

First, it is essential to understand the difference between Git and GitHub terminology.

首先,必须了解Git和GitHub术语之间的区别。

Git和GitHub的区别
(The difference in the Git and GitHub
)

Git

GitHub

Git version control is installed locally on your system.

In the previous article, we installed it locally and configured

It is a cloud-based hosting to store your scripts with different versions, repositories.

Git is primarily useful for version control and codeshare

It is a centralized source code sharing platform

It is an open-sourced licensed and provides a command-line interface

Github includes a free tier, pay as you go account as well. We get a graphical interface for GitHub

In Github, we have a centralized platform in which you can create repositories among users, and they can work on it simultaneously. By default, it provides public access for your repository, but you can modify it to a private mode as well

吉特

的GitHub

Git版本控制已本地安装在您的系统上。

在上一篇文章中,我们在本地安装并配置了

它是基于云的托管,用于存储具有不同版本和存储库的脚本。

Git主要用于版本控制和代码共享

这是一个集中的源代码共享平台

它是开放源代码的许可,并提供命令行界面

Github包括免费套餐,随用随付帐户也是如此。 我们获得了GitHub的图形界面

在Github中,我们有一个集中式平台,您可以在其中创建用户之间的存储库,他们可以同时在其上工作。 默认情况下,它为您的存储库提供公共访问权限,但您也可以将其修改为私有模式

If your team has many developers, each of them needs to install Git software locally. You can push and pull changes from their systems, but it becomes slightly complicated as the number of users grows. In the following image, it shows two separate users with Git installed on their systems. Now, both users can push and pull their changes.

如果您的团队有很多开发人员,那么每个开发人员都需要在本地安装Git软件。 您可以从他们的系统中推送和拉取更改,但是随着用户数量的增加,更改变得有些复杂。 在下图中,它显示了两个单独的用户,他们的系统上安装了Git。 现在,两个用户都可以推拉他们的更改。

GitHub is a cloud-based web hosting repository. Users can connect to it and begin storing, retrieving the codes.

GitHub是基于云的虚拟主机存储库。 用户可以连接到它并开始存储并检索代码。

Azure Data Studio中的Git和GitHub集成
(Git and GitHub integration in Azure Data Studio
)

In the above section, we discussed the differences in Git and GitHub. You can integrate these two tools to utilize the benefits of both local resources as well as a cloud solution. You can create a free account in the GitHub and create the repository. Developers can clone their repository from the Git into the GitHub.

在上一节中,我们讨论了Git和GitHub的区别。 您可以集成这两个工具,以利用本地资源和云解决方案的优势。 您可以在GitHub中创建一个免费帐户并创建存储库。 开发人员可以将其存储库从Git复制到GitHub。

First, open the URL https://github.com/ and click on Sign Up.

首先,打开URL https://github.com/ ,然后单击“注册”。

Provide the required inputs such as username, email address, password, and verify the account.

提供所需的输入,例如用户名,电子邮件地址,密码,并验证帐户。

After you create a free GitHub account, create a repository name. By default, it is a public repository so everyone can see the repository, but as a repository owner, we can choose who can commit their changes.

创建免费的GitHub帐户后,创建存储库名称。 默认情况下,它是一个公共存储库,因此每个人都可以看到该存储库,但是作为存储库所有者,我们可以选择谁可以提交其更改。

创建一个GitHub仓库
(Create a GitHub Repository
)

In the below screenshot, we see two parts for repository:

在下面的屏幕截图中,我们看到了存储库的两个部分:

  • Owner: It is the user name we created during signup for the GitHub account 所有者:这是我们在注册期间为GitHub帐户创建的用户名
  • Repository Name: It is the folder created to store the code 存储库名称:这是创建用来存储代码的文件夹

Click on Create repository. It gives you a web URL that we use to integrate Git in Azure Data Studio with the GitHub.

单击创建存储库。 它为您提供了一个Web URL,我们将其用于将Azure Data Studio中的Git与GitHub集成。

It also gives you instructions to create the repository from the command line. We will explore the git command later.

它还为您提供了从命令行创建存储库的说明。 稍后我们将探讨git命令。

使用Azure Data Studio集成GitHub和Git
(Integrate GitHub and Git using Azure Data Studio
)

Now, launch the ADS and navigate to View-> Command Palette and look for the Git Add Remote.

现在,启动ADS并导航到View-> Command Palette,然后查找Git Add Remote

It opens a pop-up window that asks for the remote name. You can give it any user-friendly name. In the ADS output, you can view the Git commands it uses for its commands. For example, it uses git remote command for this purpose. You can also enable Git: Show Git Output to view git commands it executes in the background.

它会打开一个弹出窗口,要求输入远程名称。 您可以给它提供任何用户友好的名称。 在ADS输出中,您可以查看其命令使用的Git命令。 例如,为此使用git remote命令。 您还可以启用Git:显示Git输出以查看它在后台执行的git命令。

After you specify a remote name, press enter, it asks for the URL. We need to specify the GitHub repository that we created earlier.

指定远程名称后,按Enter键,将要求输入URL。 我们需要指定我们之前创建的GitHub存储库。

We do not get any confirmation message that it added the remote URL. No error means everything is fine. However, you can view in the git output that it adds the URL we specified in the GUI.

我们没有收到确认它添加了远程URL的任何确认消息。 没有错误就表示一切都很好。 但是,您可以在git输出中查看它添加了我们在GUI中指定的URL。

Git和GitHub存储库之间的同步
(Synchronization between Git and GitHub repositories
)

Now, let’s remove the earlier file and add a new SQL script without any version. You can follow the previous article and commit a SQL script. In the timeline, we can see that custom message specified by us.

现在,让我们删除先前的文件并添加一个没有任何版本的新SQL脚本。 您可以按照上一篇文章并提交SQL脚本。 在时间轴上,我们可以看到我们指定的自定义消息。

At this point, we have prepared the following things:

至此,我们准备了以下内容:

  • Added a GitHub remote URL in the Git configuration of Azure Data Studio 在Azure Data Studio的Git配置中添加了GitHub远程URL
  • Created a SQL script and committed it in the source control 创建一个SQL脚本并将其提交到源代码管理中

Now, we have the requirement to sync this local repository of Git into the remote repository of GitHub.

现在,我们需要将Git的本地存储库同步到GitHub的远程存储库中。

To do so, navigate to View-> Command Palette-> Git Sync.

为此,请导航至“视图”->“命令面板”->“ Git同步”。

It starts the synchronization process between the local repository and remote GitHub. We have not specified any explicit branch, so I use the master branch in the GitHub. Click on OK in the below action pop-up.

它开始本地存储库和远程GitHub之间的同步过程。 我们没有指定任何显式分支,因此我在GitHub中使用master分支。 在以下操作弹出窗口中单击“ 确定 ”。

It uses a git pull command for the master branch. It also shows you the list of scripts that it starts synchronizing.

它对master分支使用git pull命令。 它还显示了开始同步的脚本列表。

Now, refresh the web browser for GitHub. In my case, I have two repositories in GitHub. After the synchronization, you can see that Repository ‘RajendraScripts’ shows a t-SQL icon. It shows that this repository has got the SQL script.

现在,刷新GitHub的Web浏览器。 就我而言,我在GitHub中有两个存储库。 同步后,您可以看到存储库“ RajendraScripts”显示一个t-SQL图标。 它表明此存储库已获得SQL脚本。

Open this repository, and it shows the SQL script file that we have in Git Source. It also shows the message we used that we specified during commit the script in the source control.

打开此存储库,它显示了我们在Git Source中拥有SQL脚本文件。 它还显示了在源代码管理中提交脚本期间指定的消息。

Now, click on the file name to view the SQL script.

现在,单击文件名以查看SQL脚本。

Can we edit the file in the GitHub and sync it back to the Git repository? Let’s check it out. Click on the highlighted edit icon in the above image to make changes in the code. It opens the script editor. In the below script, I added a few database names, as shown below.

我们可以在GitHub中编辑文件并将其同步回Git存储库吗? 让我们来看看。 单击上图中高亮显示的编辑图标,以对代码进行更改。 它打开脚本编辑器。 在下面的脚本中,我添加了一些数据库名称,如下所示。

Scroll down the page, and you see a section for Commit changes. It automatically gives you a suggestion to put the comment. In my case, it shows comment as Update sys.databases.sql

向下滚动页面,您会看到“提交更改”部分。 它会自动为您提供建议以发表评论。 就我而言,它将注释显示为Update sys.databases.sql

I added the comment Update Script – Add Master, Model, and MSDB database. It suggests that the summary should be less than 50 characters. We can put the extra characters in the description field.

我添加了注释更新脚本–添加主数据库,模型数据库和MSDB数据库 。 建议摘要应少于50个字符。 我们可以在说明字段中放入多余的字符。

Let’s modify the comment and put some details in the description box as shown below.

让我们修改注释并将一些详细信息放在描述框中,如下所示。

For the commit, we got two options. We can either commit directly to the master branch or create a new branch for this commit in GitHub. Let’s go with the first option and commit to the master branch only.

对于提交,我们有两个选择。 我们可以直接提交到master分支,也可以在GitHub中为此提交创建一个新分支。 让我们选择第一个选项,仅提交到master分支。

Click on Commit Changes. It commits our script changes, and you can see the latest script version along with the script commit summary.

单击提交更改。 它提交了我们的脚本更改,您可以看到最新的脚本版本以及脚本提交摘要。

Click on the history, and it gives you script versions to commit records. We can see it has two commits as of now.

单击历史记录,它会为您提供脚本版本以提交记录。 到目前为止,我们可以看到它有两次提交。

  • The First commit – It synchronized the script from the Git repository 第一次提交 –它同步了Git存储库中的脚本
  • The second commit– We modified the script in the GitHub editor and committed it to the master branch 第二次提交 –我们在GitHub编辑器中修改了脚本并将其提交到master分支

Now, switch to Azure Data Studio and sync the source control again using the Git sync option in the command palette. It reflects the script changes performed in the GitHub for the local repository as well. In the logs, you can see it performed the sync from the GitHub repository URL.

现在,切换到Azure Data Studio并使用命令面板中的Git sync选项再次同步源控件。 它也反映了在GitHub中为本地存储库执行的脚本更改。 在日志中,您可以看到它从GitHub存储库URL执行了同步。

You can click on the script name in the GitHub folder, and it has the latest script.

您可以单击GitHub文件夹中的脚本名称,它具有最新的脚本。

在GitHub中创建脚本版本并在Azure Data Studio的Git存储库中进行同步
(Create a Script Version in the GitHub and sync in the Git repository of Azure Data Studio
)

Let’s create another version of the script. This time we will add an additional script (highlighted below) using the ADS Git repository.

让我们创建脚本的另一个版本。 这次,我们将使用ADS Git存储库添加一个附加脚本(在下面突出显示)。

We need to commit each time it needs to be saved into the source control. As we already know, it uses Git Commit to save changes in the script.

每当需要将其保存到源代码管理中时,我们都需要提交。 众所周知,它使用Git Commit将更改保存在脚本中。

Give a suitable name for the commit. Ideally, this commit message should reflect the changes performed in a few words.

给提交一个合适的名字。 理想情况下,此提交消息应该用几句话反映出所做的更改。

You got the commit message in the Git timeline after the commit is done.

提交完成后,您会在Git时间轴中收到提交消息。

Perform manual sync between Git and GitHub repositories, and you can see the latest code being checked in.

在Git和GitHub存储库之间执行手动同步,您可以看到正在签入的最新代码。

Click on the commit message. You can see the changes in a script in a friendly interactive editor. It shows the plus (+) symbol for the lines we added in the script. Similarly, if we remove any lines, you see it with a minus (-) symbol.

单击提交消息。 您可以在友好的交互式编辑器中查看脚本中的更改。 它显示了我们在脚本中添加的行的加号(+)。 同样,如果我们删除任何行,则会看到带有减号(-)的行。

对GitHub提交的评论
(Comments on the GitHub commit
)

GitHub provides additional functionality for the users to put their comments on the scripts. Suppose your team member reviewed the script. He can put a comment on the script. Open the script version and put a comment on it, as shown below. Put a comment and click on the Comment on this commit.

GitHub为用户提供了附加功能,可将其评论添加到脚本中。 假设您的团队成员检查了脚本。 他可以对脚本发表评论。 打开脚本版本,并对其进行注释,如下所示。 提出评论,然后单击此提交评论。

It saves the comment for the corresponding commit, as shown below.

它将保存相应提交的注释,如下所示。

Other users can view the comment, reply to the comment, or use smileys as well. Click on the smiley icon and choose the appropriate smiley to showcase your reaction to the comment.

其他用户可以查看评论,回复评论或使用笑脸。 单击笑脸图标并选择适当的笑脸以展示您对评论的React。

We see the reaction on the comment in the following image.

我们在下图中看到对评论的React。

结论 (Conclusion)

In this article, we explored the integration of Git and GitHub repository with Azure Data Studio. GitHub is a web-based cloud hosting, and you can sync your local repositories into it. It is bidirectional sync that means you can modify the script either in Git or in GitHub console, and changes reflect in the other repository. We will explore more on the source control in Azure Data Studio in my upcoming articles. Stay tuned!

在本文中,我们探讨了Git和GitHub存储库与Azure Data Studio的集成。 GitHub是一个基于Web的云托管,您可以将本地存储库同步到其中。 这是双向同步,这意味着您可以在Git或GitHub控制台中修改脚本,并且更改会反映在其他存储库中。 我们将在我的后续文章中探索有关Azure Data Studio中的源代码控制的更多信息。 敬请关注!

目录 (Table of contents)

The SQL Server Assessment Extension for Azure Data Studio
Source Control using Git in Azure Data Studio (ADS)
Integrating Azure Data Studio with Git and GitHub
Working with Git components in Azure Data Studio
适用于Azure Data StudioSQL Server评估扩展
在Azure Data Studio(ADS)中使用Git进行源代码控制
将Azure Data Studio与Git和GitHub集成
在Azure Data Studio中使用Git组件

翻译自: https://www.sqlshack.com/integrating-azure-data-studio-with-git-and-github/

mac azure git

mac azure git_将Azure Data Studio与Git和GitHub集成相关推荐

  1. mac azure git_在Azure Data Studio中使用Git组件

    mac azure git This article gives an insight into the terms in the Git repository of Azure Data Studi ...

  2. androidstudio自带git用法_Android Studio使用Git版本控制github

    由于安卓开始做大作业,小组形式,所以为了版本控制使用到了github,由于之前对git稍微熟悉,所以摸索起来不是很难. 首先你需要下载git,自行谷歌 1.在Android Studio配置git以及 ...

  3. azure云数据库_Azure Data Studio中Windows的数据库管理工具扩展

    azure云数据库 Azure Data Studio provides a modern and productive experience for managing on-premise and ...

  4. azure云数据库_Azure Data Studio中的服务器和数据库仪表板

    azure云数据库 Azure Data Studio (ADS) is an integrated, lightweight database development for supporting ...

  5. github 和git_学习编码时如何学习Git和GitHub

    github 和git by Iago Rodrigues 通过Iago Rodrigues 学习编码时如何学习Git和GitHub (How you can learn Git and GitHub ...

  6. Visual Studio Code(VS Code)与Git Source Control集成

    This article explores Visual Studio Code integration with Git Source Control. 本文探讨了Visual Studio Cod ...

  7. 具有Ubuntu和Azure Data Studio的Linux上SQL Server 2019

    In the previous articles of this series on using SQL Server 2019 on Ubuntu, we have explored the fol ...

  8. azure 入门_Azure Data Studio(ADS)入门; 初始安装和配置

    azure 入门 Microsoft Azure Data Studio is a new GUI-based (vs CLI) lightweight tool for developing and ...

  9. Azure data studio 跨平台数据库管理工具试用

    最近折腾 azure sql database 的时候发现了微软的一款新的数据库管理工具:azure data studio.从名字上看 azure data studio 好像是专门为 azure ...

最新文章

  1. HDU 5734 Acperience
  2. iOS病毒XcodeGhost批量检测工具,开源Github(检测ipa文件)
  3. wofstream写中文失败,导致stream对象badbit
  4. 力扣: 88. 合并两个有序数组
  5. [转]linux 有效用户和实际用户的区别
  6. mac安装完mysql后关机特别慢_mysql-Mac终端下遇到的问题总结
  7. pythonmysql查询转list_python 数据库查询结果转对象
  8. SEO如何辨别真假Baiduspider
  9. Linux 中断详解
  10. C++ 输出Unicode字符的正确方法
  11. k3 审核流程图_金蝶K3操作流程图详解(doc 64页)
  12. 声反馈(啸叫)如何避免产生和解决
  13. php 复制到剪切板,兼容多种浏览器”复制到剪贴板”的解决方案
  14. 基于php和mysql的网上购物系统设计与实现_基于PHP+MySQL的网上购物系统设计与实现...
  15. 区块链专利全球第一竟是它?
  16. google浏览器添加抓包插件
  17. 数学方法002 | 利用恒等式证明不等式
  18. Jenkins打包部署项目到Windows或Linux运行
  19. 如何给PDF文件添加页眉页脚,一分钟轻松搞定
  20. java自学-oop static

热门文章

  1. UE4 打包C++项目到win32平台报错 could not find mspdbcore.dll
  2. 1-添加自己的Lua执行函数(ESP8266-SDK开发(lua版本))
  3. HDU 2588 GCD
  4. c c++ sizeof
  5. 讨论记录:求大于一个时间段的最大平均积分,O(n)时间实现
  6. 令人郁闷的DateTime.ToString()方法
  7. HIT Software Construction Review Notes(3-1 Data Type and Type Checking)
  8. VScode配置C语言环境 亲测 可用!!!
  9. html页面获取时间格式,js实现动态获取系统时间,显示到页面上
  10. python中的继承有什么特点_Python类的继承机制是什么