GitHubへのアップロード方法
JavaScriptの学習(JavaScript #9:電卓に1文字消すボタンを追加する)のソースコードをローカルのGitで管理していたが、これをGitHubへアップロードしてみようと思う。
1. GitHubアカウントの登録
2. 新しいレポジトリの作成
1. GitHubアカウントの登録
登録済みなのでスキップ
2. 新しいレポジトリの作成
◆ GitHubの自分のDashboardページ右上の [+]ボタンより "New repository" をクリック
◆ Repository nameの入力と 公開設定(Public/Private)を選択し [Create repository] ボタンをクリック
◆ レポジトリを作成するとアップロード方法が表示される
◆ git push時にエラーが出る場合
◆ Repository nameの入力と 公開設定(Public/Private)を選択し [Create repository] ボタンをクリック
◆ レポジトリを作成するとアップロード方法が表示される
新規の場合は "…or create a new repository on the command line" に書かれたコマンドw実行
既にGitで管理している場合は "…or push an existing repository from the command line" に書かれたコマンドを実行
既にGitで管理している場合は "…or push an existing repository from the command line" に書かれたコマンドを実行
◆ git push時にエラーが出る場合
"git push -u origin" を実行したところ以下のメッセージが表示された
xxx@xxx:~/docker/node.js/calc-vite$ git push -u origin
fatal: The current branch main has no upstream branch.
To push the current branch and set the remote as upstream, use
git push --set-upstream origin main
To have this happen automatically for branches without a tracking
upstream, see 'push.autoSetupRemote' in 'git help config'.



0 件のコメント:
コメントを投稿