Gitリポジトリ:新しいリモートアドレスにプッシュ、ローカルおよびリモートブランチの名前を変更します

Gitのグローバル設定(グローバル設定)

git config --global user.name "wangyf"
git config --global user.email "[email protected]"

新しいリポジトリを作成します(新しい倉庫を作成します)

git clone http://192.168.3.11/wangyf/XXX.git
cd sdk-cms
touch README.md
git add README.md
git commit -m "add README"
git push -u origin master

既存のフォルダ(ローカルエンジニアリングの存在、新しいリモートアドレスにプッシュ)

cd existing_folder
git init
git remote add origin http://192.168.3.71/wangyf/sdk-cms.git
git add .
git commit -m "Initial commit"
git push -u origin master

既存のGitリポジトリ(既存のプロジェクト、新しいリモートアドレスにプッシュ)

cd existing_repo
git remote rename origin old-origin
git remote add origin http://192.168.3.71/wangyf/sdk-XXX.git
git push -u origin --all
git push -u origin --tags

ローカルおよびリモートブランチの名前を変更git-

git branch -m old_branch new_branch # Rename branch locally 
git push origin :old_branch # Delete the old branch 
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote

Gitリポジトリ:一般的に使用されるコマンド  https://blog.csdn.net/fly910905/article/details/79166272

アイデア:Gitの共通メニュー操作と共通のコマンド[枝が作成し、チェックアウト、コミット、マージ]  https://blog.csdn.net/fly910905/article/details/79501896

おすすめ

転載: blog.csdn.net/fly910905/article/details/91821452