github 올리기

datajcthemax·2023년 6월 13일
0

git/github

목록 보기
1/18
post-thumbnail

Create a new repository on GitHub.

Go to GitHub's website and log in to your account.
Click on the "+" button in the upper right corner, then select "New repository".
Name your repository, write a short description, choose to make the repo either public or private, and initialize it with a README if you want.
Click "Create repository".
Create a new directory on your computer and initialize it as a Git repository, or navigate to an existing directory containing your project.

Open Terminal (Mac and Linux) or Command Prompt (Windows).
Navigate to the directory where you want to create your new repository or to the directory your project is in. You can change the current working directory by using the cd command followed by the path to your directory.
Once you're in the directory, type git init to initialize a new Git repository.
Add the files in your new local repository. This stages them for the first commit.

Use the command git add . to add all the files in the current directory to the staging area for Git. If you want to add specific files, you can use git add .
Commit the files that you've staged in your local repository.

Use the command git commit -m "First commit" to commit the files.
In Terminal, add the URL for the remote repository where your local repository will be pushed.

Use the command git remote add origin remote repository URL. This sets the new remote.
Then verify the new remote URL using the command git remote -v.
Push the changes in your local repository to GitHub.

Use the command git push origin master to push your local repo to GitHub. If you're pushing to the main branch, use git push origin main.
Remember, replace remote repository URL with the URL of your own repository on GitHub. You can find this URL on the main page of your repository on GitHub's website, it should look something like 'https://github.com/username/repo.git'. Also, replace master or main with the branch that you want to push to if you are not pushing to the master or main branch.

Before you can push, you might need to set your username and email in the git config if you haven't done so already. You can do this with the commands git config --global user.name "Your Name" and git config --global user.email "your.email@example.com".

These instructions are for uploading an existing project from your local machine to GitHub. If you want to clone a repository from GitHub and make changes locally, the process is a bit different. If you have any questions or run into any issues, feel free to ask!

0개의 댓글