# resource git clone https://github.com/TonyHo722/bash_study git clone http://TonyHo@61.66.242.171/r/linux-xlnx git clone http://github.com/Xilinx/linux-xlnx ## command ``` git clone https://github.com/TonyHo722/bash_study cd bash_study git remote rename origin upstream git remote add origin http://TonyHo@61.66.242.171/r/linux-xlnx cat .git/config git push -f --set-upstream origin cat .git/config ``` ## before git push -f --set-upstream origin - current branch = master ``` [branch "master"] remote = upstream merge = refs/heads/master ``` ## after git push -f --set-upstream origin - current branch = master ``` [branch "master"] remote = origin merge = refs/heads/master ``` ## log ``` ubuntu@ubuntu2004:~/test$ git clone https://github.com/TonyHo722/bash_study Cloning into 'bash_study'... remote: Enumerating objects: 184, done. remote: Counting objects: 100% (184/184), done. remote: Compressing objects: 100% (124/124), done. remote: Total 184 (delta 70), reused 148 (delta 36), pack-reused 0 Receiving objects: 100% (184/184), 68.37 KiB | 1.29 MiB/s, done. Resolving deltas: 100% (70/70), done. ubuntu@ubuntu2004:~/test$ cd bash_study ubuntu@ubuntu2004:~/test/bash_study$ git remote rename origin upstream ubuntu@ubuntu2004:~/test/bash_study$ git remote add origin http://TonyHo@61.66.242.171/r/linux-xlnx ubuntu@ubuntu2004:~/test/bash_study$ cat .git/config [core] repositoryformatversion = 0 filemode = true bare = false logallrefupdates = true [remote "upstream"] url = https://github.com/TonyHo722/bash_study fetch = +refs/heads/*:refs/remotes/upstream/* [branch "master"] remote = upstream merge = refs/heads/master [remote "origin"] url = http://TonyHo@61.66.242.171/r/linux-xlnx fetch = +refs/heads/*:refs/remotes/origin/* ubuntu@ubuntu2004:~/test/bash_study$ git push -f --set-upstream origin Password for 'http://TonyHo@61.66.242.171': Total 0 (delta 0), reused 0 (delta 0) remote: Processing changes: refs: 2, done To http://61.66.242.171/r/linux-xlnx + 752b53e...d502054 master -> master (forced update) Branch 'master' set up to track remote branch 'master' from 'origin'. ubuntu@ubuntu2004:~/test/bash_study$ cat .git/config [core] repositoryformatversion = 0 filemode = true bare = false logallrefupdates = true [remote "upstream"] url = https://github.com/TonyHo722/bash_study fetch = +refs/heads/*:refs/remotes/upstream/* [branch "master"] remote = origin merge = refs/heads/master [remote "origin"] url = http://TonyHo@61.66.242.171/r/linux-xlnx fetch = +refs/heads/*:refs/remotes/origin/* ubuntu@ubuntu2004:~/test/bash_study$ ```
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up