marge 分支的时候常常忽略的问题

82 阅读1分钟

创建并切换分支

git branch -b sustainteamConfing1.0.2

注意点: 要在新建分支里面,merge(合并) 分支

 git merge master

下一步 提交远程仓库,你会发现git push

fatal: No configured push destination.
Either specify the URL from the command-line or configure a remote repository using

    git remote add <name> <url>

and then push using the remote name

    git push <name>

提示让你 git remote add <name> <url>

 git remote add https://e.coding.net/s
ustainteam/sustainteamreact/sustainteamCofing1.0.0.git
usage: git remote add [<options>] <name> <url>

    -f, --fetch           fetch the remote branches
    --tags                import all tags and associated objects when fetching
                          or do not fetch any tag at all (--no-tags)
    -t, --track <branch>  branch(es) to track
    -m, --master <branch>
                          master branch
    --mirror[=(push|fetch)]
                          set up remote as a mirror to push to or fetch from

好吧,我错了, 然后我尝试着重新

 git remote add origin https://e.c
g.net/sustainteam/sustainteamreact/sustainteamCofing1.0.0.git

然后这个我没有在提示后尝试,我又重新

git add --all

git commit -m "rti"

小插曲哦

git remote add

https://e.coding.net/sustainteam/sustainteamreact/sustainteamCofing1.0.0.git

PS D:\Company2023\售票管理系统\shole-shopping> git remote add https://e.coding.net/s
ustainteam/sustainteamreact/sustainteamCofing1.0.0.git
usage: git remote add [<options>] <name> <url>

    -f, --fetch           fetch the remote branches
    --tags                import all tags and associated objects when fetching
                          or do not fetch any tag at all (--no-tags)
    -t, --track <branch>  branch(es) to track
    -m, --master <branch>
                          master branch
    --mirror[=(push|fetch)]
                          set up remote as a mirror to push to or fetch from

然后我动了一下一根筋的脑袋,嘿嘿

git remote add origin https://e.c
g.net/sustainteam/sustainteamreact/sustainteamCofing1.0.0.git
咦

咦,居然可以了

 git push origin  sustainteamConfig
 Enumerating objects: 81, done.
 Counting objects: 100% (81/81), done.
 Delta compression using up to 12 threads
 Compressing objects: 100% (69/69), done.
 Writing objects: 100% (81/81), 370.31 KiB | 3.06 MiB/s, done.
 Total 81 (delta 13), reused 0 (delta 0)
 remote:
 remote: Create a merge request for 'sustainteamConfing1.0.2' on CODING by visiti
 remote:     https://sustainteam.coding.net/p/sustainteamreact/d/sustainteamCofin
 nteamConfing1.0.2
 remote:
 To https://e.coding.net/sustainteam/sustainteamreact/sustainteamCofing1.0.0.git
 * [new branch]      sustainteamConfing1.0.2 -> sustainteamConfing1.0.2

nice!