{"id":49469,"date":"2018-06-13T13:00:00","date_gmt":"2018-06-13T18:00:00","guid":{"rendered":"https:\/\/blog.cpanel.com\/?p=49469"},"modified":"2018-06-13T13:00:00","modified_gmt":"2018-06-13T18:00:00","slug":"git-version-control-series-setting-up-git","status":"publish","type":"post","link":"https:\/\/devel.www.cpanel.net\/blog\/products\/git-version-control-series-setting-up-git\/","title":{"rendered":"Git Version Control Series: Setting Up Git"},"content":{"rendered":"
This is the fourth in a series of blog posts around Git and a new feature in version 72,\u00a0Git Version Control<\/a>.\u00a0 See the full list of entries in this series at the end of this post!\u00a0 <\/em><\/p>\n If you follow our\u00a0feature request site<\/a>, you already know about our upcoming feature, Git™ Version Control. We’re designing it to make hosting repositories as easy for developers as a “Hello World!” script.<\/p>\n Git’s extremely useful when you configure it to transfer content between a local and remote repository. When you set this up, changes on your local branch automatically push to your cPanel-hosted repository.\u00a0Of course, before you can use our feature for this, you will need to set everything up.<\/p>\n Before you can do anything in Git, you need repositories! You’ll need one on your local computer and one hosted on your cPanel account.<\/p>\n To create one on your cPanel account:<\/span><\/p>\n <\/a><\/p>\n To ensure that you don’t accidentally transfer changes, create and check out a separate branch. Here, we’re calling that branch ‘release’.<\/p>\n <\/a><\/p>\n <\/a><\/p>\n Then, push the branch to the cPanel-hosted repository.<\/p>\n <\/a><\/p>\n Congratulations! The branch on your local computer is connected to the branch on your cPanel account. Git now assumes that you want changes on the local branch pushed to your cPanel-hosted repository. You’re not quite finished yet, though.<\/p>\n <\/a><\/p>\n <\/a><\/p>\n Your cPanel-hosted repository is a full repository with all of the features of any Git repository. You should make sure to push and pull regularly. Unlike other Git hosts, cPanel-hosted repositories include access to the repository’s working tree. Because of this, you should work in your local computer’s copy of the repository. Then, push the work up to your cPanel-hosted repository when you’re ready.<\/p>\n <\/a><\/p>\n When you use your repository, you’ll want to set up a\u00a0branching strategy<\/a>\u00a0to help you separate lines of development. There are a couple of different ways to do this, and the method you choose should be tailored to your specific needs.<\/p>\n When you push or pull, Git will ask you to authenticate with your cPanel account. To skip this step without security risks, install your SSH public key on your cPanel account and authorize it. You can use the\u00a0SSH Access<\/em><\/a>\u00a0interface in cPanel to set this up.<\/p>\n When you commit changes, you also create a commit message to send with them. Good commit messages make Git\u00a0really<\/em>\u00a0useful.<\/p>\n <\/a><\/p>\n Since we display the first line in the interface, they’ll help you quickly identify the state of your active branch, too. There are\u00a0some<\/a>\u00a0great<\/a>\u00a0guid<\/a>es<\/a>\u00a0to creating good commit messages.<\/p>\n If you already use Git, we hope that this\u00a0feature will knock your socks off! If you don’t, we’re hoping we can help you start!<\/p>\n A note fro<\/span>m benny: <\/span><\/em><\/p>\n Want to be involved in the development process? Post your ideas, comments, and questions on the\u00a0feature request<\/a>. You can also join us in our slack<\/a> or discord<\/a> channels, post your questions on the cPanel forums<\/a> or subreddit<\/a>, or come visit Houston, Texas for the 2018 cPanel Conference<\/a>, October 1st – 3rd. Need to catch up on the previous posts about Git Version control? Here they are!<\/em><\/p>\n This is the fourth in a series of blog posts around Git and a new feature in version 72,\u00a0Git Version Control.\u00a0 See the full list of entries in this series at the end of this post!\u00a0 If you follow our\u00a0feature request site, you already know about our upcoming feature, Git™ Version Control. We’re designing it […]<\/p>\n","protected":false},"author":77,"featured_media":64961,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"footnotes":""},"categories":[49],"tags":[2021,653,2025,1869,2029],"class_list":["post-49469","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-products","tag-cpanel-git-integration","tag-git","tag-git-version-control","tag-v72","tag-version-72"],"acf":[],"yoast_head":"\n
\nCreating repositories<\/h2>\n
\n
\n<\/a>
\n<\/span><\/li>\nSetting up your workflow<\/h2>\n
\n
\n
Keep everything up-to-date<\/h2>\n
Select the right branching strategy for your needs<\/h2>\n
Skip authentication without skipping good security practices<\/h2>\n
Write great commit messages<\/h2>\n
\n\n