-
Notifications
You must be signed in to change notification settings - Fork 5.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I want to use git #257
Comments
hi rimjhim frist If you've never used Git, you may be nervous about it. There's nothing to worry about—just follow along with this step-by-step getting-started guide, and you will soon have a new Git repository hosted on GitHub. Before we dive in, let's clear up a common misconception: Git isn't the same thing as GitHub. Git is a version-control system (i.e., a piece of software) that helps you keep track of your computer programs and files and the changes that are made to them over time. It also allows you to collaborate with your peers on a program, code, or file. GitHub and similar services (including GitLab and BitBucket) are websites that host a Git server program to hold your code. Step 1: Create a GitHub account Create a GitHub account Pick a username (e.g., octocat123), enter your email address and a password, and click Sign up for GitHub. Once you are in, it will look something like this: Signed in to GitHub Step 2: Create a new repository Create a new repository Enter a name for your repository (e.g, "Demo") and click Create Repository. Don't worry about changing any other options on this page. Congratulations! You have set up your first repo on GitHub.com. Step 3: Create a file New repo on GitHub Don't panic, it's simpler than it looks. Stay with me. Look at the section that starts "...or create a new repository on the command line," and ignore the rest for now. Open the Terminal program on your computer. Terminal Type git and hit Enter. If it says command bash: git: command not found, then install Git with the command for your Linux operating system or distribution. Check the installation by typing git and hitting Enter; if it's installed, you should see a bunch of information about how you can use the command. In the terminal, type: mkdir Demo Change your terminal to the Demo directory with the command: cd Demo echo "#Demo" >> README.md cat README.md Terminal To tell your computer that Demo is a directory managed by the Git program, enter: git init git add README.md Red Hat Developers Blog To make a commit, enter: git commit -m "first commit" Step 5: Connect your GitHub repo with your computer git remote add origin https://github.com/<your_username>/Demo.git Now we have connected our local copy of the Demo repository to its remote counterpart on GitHub.com. Your terminal looks like this: Terminal Now that we have added the remote, we can push our code (i.e., upload our README.md file) to GitHub.com. Once you are done, your terminal will look like this: Terminal And if you go to https://github.com/<your_username>/Demo you will see something like this: Demo repo on GitHub That's it! You have created your first GitHub repo, connected it to your computer, and pushed (or uploaded) a file from your computer to your repository called Demo on GitHub.com. Next time, I will write about Git cloning (downloading your code from GitHub to your computer), adding new files, modifying existing files, and pushing (uploading) files to GitHub |
No description provided.
The text was updated successfully, but these errors were encountered: