Since I am a beginner, I sometimes forget it, so it is a memorandum.
Open Terminal, cd to the directory containing the Java file you want to register, and hit the following command.
$ git init
.gitignore is written to specify the type of file you do not want to register (class file in Java). As the name implies, it ignores the specified file. There are several ways to make it, but I use gibo. gibo is an excellent one that automatically generates a .gitignore file. Type the following command.
gibo java >> .gitignore
This is the end of local work.
# 3. Create a remote repository
Go to GitHub and create a new repository.
At that time, you can select the option to automatically generate .gitignore, but do not select it because it has already been created.
Once the repository is created, the HTTPS URL will be issued, so copy it.
# 4. Associate the remote repository with the local repository.
Type the following command:
```$ git remote add origin url```
Paste the remote HTTPS URL you copied earlier into the URL part.
5. add, commit & push!
$ git add . $ git commit -m "remote upload" $ git push -u origin master
### that's all!
Recommended Posts