Xamarin 101: How to use Git and GitHub in Xamarin Development
Are you new to Xamarin?
Are you new to Git and GitHub as well?
In this post, you will learn how to apply basic Git and GitHub in your Xamarin Forms app.
Download and install Git version control here. https://git-scm.com/
Sign up for GitHub here. https://github.com/
Verify your GitHub account by going to your email and clicking the verification link.
Go to your Tools -> Extensions and Updates -> Online. Then search and install GitHub Extension for Visual Studio.
Click the Add to Source Control button at the lower right part of your Visual Studio. Click the Git. This will create a version control system in your new or existing directory.
Go to your View menu -> Team Explorer. Sign in your GitHub in your Team Explorer area. After signing in, click the Publish to GitHub button.
GitHub extension will prompt you to enter an optional description of your project before publishing it online. Leave the Private Repository unchecked, the private repository is for paid GitHub account.
Click on the Publish button to upload it to your GitHub repository.
Go to your GitHub profile then to your repositories. You will see that your project’s name is appearing in front of you. That means you’ve successfully upload your sample project.
Now try to edit any code or add a new file (class, interface, etc. ) in your demo project and save it. After adding a file or editing your project, go again to your Team Explorer and click the Changes bar. This time you will try to see if you can update or edit your project in your GitHub account through your Visual Studio.
Write a commit message. This is describing the changes you’ve made.
Click the Commit All and Push. This will create a Git history of your project locally and will upload it to its respective repository.
Go again to your GitHub account and then check your project in your repositories. You will see the changes that you just made.
Wrapping up, Git and GitHub are great tools for using version control locally and online. If you’re new to software development, these skills are valuable to have in real-world application development as well as in open source development. This is just a starter and quick demo of the Git and GitHub, most of the commands you will be using are in the cheat sheets below. Just click on these links to download them.
Try it, and let me know if it works. Hope you like this post. Until next time. Happy coding!