git相关操作

1.git alter username

git config user.name

git config user.email

git config --global user.name "username"

git config --global user.email "email"

2.git del remote files

git status
git rm .idea --cached -r
git rm app.iml --cached -r
git add -A
git status
git commit -m "update gitignore"
git push

3.git fetch upstream

https://help.github.com/articles/fork-a-repo/

 git remote add upstream xxxx.git
 git fetch upstream

 git merge upstream/master
 git status

git commit -m "xx"
git push

3.2.https://gist.github.com/CristinaSolana/1885435
git pull upstream master

 git merge origin/master --allow-unrelated-histories

one command sync
 git fetch upstream
1. git merge upstream/master 

2.git merge upstream/develop master
 git push

4.transfer remote branch
git remote set-url origin ssh://git-codecommit.us-west-2.amazonaws.com/v1/repos/TestAndroid
git status
git push

4.1.right click mouse--> git Bash Here   input  git clone <remote url>
4.2.1  copy the file where need under vcs
4.2.2. git status
4.3.git add -A
4.4.git status 
4.5.git commit -m "info"
4.6.git push

5.0 git set proxy

git config --global http.proxy http://127.0.0.1:1080
git config --global https.proxy https://127.0.0.1:1080
git config --global http.proxy 'socks5://127.0.0.1:1080' 
git config --global https.proxy 'socks5://127.0.0.1:1080'

cancel proxy
git config --global --unset http.proxy
git config --global --unset https.proxy

切换分支

git checkout xxxx

6.create a new repository

…or create a new repository on the command line

echo "# TEstx" >> README.md
git init
git add README.md
git commit -m "first commit"
git remote add origin git@github.com:montotone/TEstx.git
git push -u origin master


------>git pull origin branchname --allow-unrelated-histories

…or push an existing repository from the command line

git remote add origin git@github.com:montotone/TEstx.git
git push -u origin master

new branch

https://blog.csdn.net/zengxiaosen/article/details/72628724

git cherry-pick命令的作用,就是将指定的提交(commit)应用于其他分支。


$ git cherry-pick <commitHash>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值