[RUBY] How beginners can upload their apps to GitHub

Prerequisites

Be registered on Github Have an app

Big flow

① Create a working tree ② Register the file in the index ③ Register the file in the local repository ④ Connect to remote repository ⑤ Register the file in the remote repository

Premise

The current directory is in the folder that contains the files you want to upload to GitHub

① Create a working tree

git init
Make sure .git is generated ls -a

② Register the file in the index

git add *
Remarks

③ Register the file in the local repository

git commit -m 'test'
Remarks -m is a function to add a comment to a commit and may or may not be added.
Confirmation Confirm that it was committed git log Author: xxx Date: Sun xxx xx 17:35:23 2020 +0900

test

④ Connect to remote repository

git remote add origin https://github.com/xxxxxxxx/xxxxxxxx.git



 <br> Remarks
 origin is the remote repository name and can be any name you like. Basically origin
 https / //github.com/xxxxxxxx/xxxxxxxx.git is the remote repository URL. Granted when you create a repository on a GitHub web page. (Maybe there's something like that on the repository page)

 <br> Confirmation
```git remote -v```
 <br> Remarks
 The connected remote repository destination is displayed


## ⑤ Register the file in the remote repository
```git push origin master```

 <br> Remarks
 master is the branch name. The default is master.
 If you want to check your current branch, use the following command
git branch --contains

 <br> Confirmation
 Visit your GitHub repository page and make sure it's uploaded


Recommended Posts

How beginners can upload their apps to GitHub
[Even beginners can do it! ] How to write Javadoc
How to use GitHub for super beginners (team development)
How to push from Tarminal to GitHub
Must-see for beginners! How to manage your Xcode project on Github
[Rails] How to upload images using Carrierwave
[Ruby] How to use slice for beginners
How to achieve file upload with Feign
[For beginners] How to debug in Eclipse
[Even beginners can do it! ] How to create Java environment on Windows 10 (JDK14.0.1)
[For beginners] How to implement the delete function
Git and GitHub ~ How to fix common errors ~
[Rails] How to upload multiple images using Carrierwave
[For super beginners] How to use autofocus: true
How to deploy
[Even beginners can do it! ] How to install Eclipse on Windows 10 (Java environment construction)
How to implement login request processing (Rails / for beginners)
How to push an app developed with Rails to Github
[For beginners] How to operate Stream API after Java 8
[Spring Boot] How to create a project (for beginners)
How to test file upload screen in Spring + Selenium
How to run Java EE Tutial on github on Eclipse