――I'm developing in a Docker environment at my company, but I'm not sure, so I decided to create the environment myself.
--Creating a repository on github --Synchronization of the created repository with the local environment --Synchronization of github and docker
--github account --dockerhub account
--Create a repository from the "+" button on the top right of github. Anyone can do this as it is normally written.
--Copy the URL displayed after creating the repository --Creating a directory to synchronize locally
init
# ~/Create a directory under Documents (create location and directory name are arbitrary)
mkdir ~/Documents/Sample
#Go to the directory you created and clone
cd ~/Documents/Sample
git clone [URL]
#This~/Documents/A directory is created with the repository name created under Sample
However, it is different if you want to upload a file to the extent that it appears locally.
# ~/Create a directory under Documents (create location and directory name are arbitrary)
mkdir ~/Documents/Sample
#Move to the created directory and initialize
cd ~/documents/Sample
git init
#Create a file and commit various things
touch sample.txt
git add -A
git commit -m "first commit"
#Get local information
git remote add origin [URL]
#Finally push
git push origin master
--After logging in to Dockerhub, click on the fingerprint mark on the upper right and select "Account Setting". --After that, select Linked Accounts, and then link along the flow.
--Creating a repository on docker hub
--Select Repositories from the menu bar, then select Create Account --After entering the Name and Description, click the github mark below to select which repository to link with.
For the time being, cooperation is complete.
Recommended Posts