![]() ![]() This process pushed your commits to GitHub. I usually go private for all my projects, unless I want to share them when I feel they’re ok for public visibility. Now you can choose whether to post the project publicly, or privately. We’ll go through the procedure of connecting VS Code to GitHub, which you only need to do once: Now we’re going to publish this repository to GitHub.Ĭlick the “Publish Branch” blue button. If this is the first time you use Git, you might get this error message:Ĭlick the “Cancel” button here and complete the step described here (or install and configure GitHub Desktop as I explained in the beginning of this lesson). Would you like to stage all your changes and commit them directly?” You will get a pop up saying “There are no staged changes to commit. Try it: write “My first commit” to the “Message” box, and press cmd-Enter / ctrl-Enter, or press the ✔ icon: What’s a commit? It’s a set of changes you made to the codebase that you can wrap under a single, atomic change. Now the repository is ready for your first commit. The file on the right is still the same, but the left sidebar changed to show the list of files changed in your repository. Git must be set up for every different project you have.Ĭlick Initialize Repository and you’ll see this: This is because we don’t have Git set up on the project yet. Now click the Source Control icon in the toolbar: Press cmd-S or ctrl-S or use the File -> Save menu to save. Add some content to it, like alert('test'): menu.Ĭreate a test.js file by clicking the File → New File menu, or by right-clicking the in the left sidebar (under you see the TESTGIT line). Now drag this folder into the VS Code icon to open it in VS Code, or use the File → Open Folder. That’s where you’ll store all your projects. Let’s now see how Git works within VS Code.Ĭreate a folder dev in your user home folder on your computer. Make sure you enter your name and email, not those fake ones! Using this method you have to set your name and email in the terminal using these 2 commands: git config -global user.name "your name" git config -global user.email " " NOTE: If you prefer, you can download “just Git” from here, that will skip the GitHub integration). Installing this app also installs Git, so you don’t need to do anything more. ![]() Accept this to set the username and email of Git, which you’ll need to create commits. Now go back to the GitHub Desktop app, and click “Sign in to ”, the blue button:įinally you’re ready to configure Git. Pick the username wisely, you’ll have a public GitHub profile, like I do here: Īfter confirming your email, you’ll be shown a screen, click “Skip personalization” and pick the free plan: You’ll be sent to GitHub to create an account: We’re going to use this for all the projects in the bootcamp, and that’s where you’ll see the projects code I publish.Īfter installing it, open the application.Ĭlick “Create your free account”. ![]() It’s a website that hosts code, and lets you collaborate on Open Source projects, host your own public and private repositories. This installs a graphical user interface to use Git, and also Git itself. The easiest way to do that is by installing the GitHub Desktop application.Īvailable for Windows and Mac, you can download it from here: It also allows us to work with a team, because each individual person can push commits to the codebase and Git takes care of making sure there are no conflicts with changes made by other people.īefore going on, you need to install Git on your computer. And in a team, you can find out who made a change.Įach time we make a change or add a new feature or fix a bug we add a little explanation, and we commit the changes. ![]() It allows us to work for months and years on a project, and yet get back to each individual change we made on the codebase. A tutorial on how to set up Git and GitHub from scratch ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |