[Ruby] I want to push an app made with Rails 6 to GitHub

less than 1 minute read

procedure


0. Settings (when developing with multiple people)

terminal


$ git config --global user.name "name"
$ git config --global user.email [email protected] #address

Initialize git repository created with ####1.rails new

terminal


$ git init # initialization

2. Add data to git repository and commit

terminal


$ git status # Check file status
$ git add -A #Specify files to save -A can add all files, or specify file name and add one by one
$ git commit -m "message content"

3. Launch a push destination repository on GitHub

github 1.png

4. Push to GitHub

terminal


$ git remote add origin https://github.com/tkse16/sumple_app.git #Associate the GitHub repository with origin
$ git push -u origin master # Push to GitHub. -u is not necessary

that’s all!