Copy the entire line and paste it into the Terminal app. Within that section, find the line that starts with git remote add origin. You should use the “push an existing repository from the command line” instructions. In the top “Quick setup” section, click on the “HTTPS” button if it is not already selected, and see that all the instructions change the links to start with https. The next page will list the repository URL we will need to tell Git where to push your app’s source code to.īe certain you are viewing the instructions for HTTPS, so that it will work with the PAT. On the “Create a new repository” page, enter a repository name (like “railsgirls”), choose “public” for the repository’s visibility and click the “Create repository” button. Having trouble finding the right link? Visit this new repository page directly. In the dropdown, choose “New repository”. Once signed in to GitHub, click on the plus icon ( +) in the top right corner of the navigation bar. Now that you have a GitHub account, you can push (Git terminology for upload) your saved work to GitHub and share it with others. Push your app to GitHub using the command line (part 1) This will be important in the next section, when you’ll create your PAT. Using a Personal Access Token (PAT) requires that you use an HTTPS connection. GitHub offers connections over HTTPS and SSH. The easiest method for managing authentication is creating a Personal Access Token (PAT) that will have matching parts stored on your computer and also on the GitHub site.īecause you are trying to get the code on your computer into your account on the GitHub website, you’ll need to connect via the internet. Visit the GitHub website and create an account or login if you already have an account at Github. We will use this to save and share our app’s source code. It is a hub for source code saved in Git. GitHub is a free, online, code-sharing platform. (The -m in the above command stands for “message”.) Create a GitHub account The git commit command shown below will save the staged files in Git, along with the message “First commit”. By running the following command you will add all those files staging area in Git, ready to be saved (committed). We want to save all these files in Git so they can be pushed to the GitHub repository you just created. This will list out all the changed files in your app directory, which should be all the files for your app. Open the Terminal app, navigate to your railsgirls app directory and run the following command. To check if a profile is already set up in Git, you can run this command, and look for the user.name and user.email values in the output: git config -list Saving work in Git Git config -global user.email "your-email" Be aware: the name and email address you configure here will be visible to others! git config -global user.name "your-name" You can also use a nickname or an alias if you don’t want to use your real name and email address. You can see who made which change and when.Ĭhange “your name” and “your email” with your name and your email address. This profile will be used to describe who made the changes to files we’ll store in Git. Once we’re sure Git is installed, we can set up our local profile in Git. Please install Git by going to the Git website, download the Git installer for Windows and running the downloaded installer.Īfter installing or upgrading, run the git -version command again to make sure you are using a more recent version.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |