Git Commands

[size=large][b]First person Setup[/b][/size]
[b]1. Set up a new repository from local to remote [/b]
git init
git add --all
git commit -m "Initial Commit from SVN migration"
git remote add origin ssh://git@cedt-icg-bitbucketcli.nam.nsroot.net:7999/ep/mfa.git
git push -f origin master

git config --global user.name "Your Name Comes Here"
git config --global user.email you@yourdomain.example.com
Git help clone

[b]2. add submodule[/b]
git submodule add [repo URI] [folder name]
eg: git submodule add ssh://git@cedt-icg-bitbucketcli.nam.nsroot.net:7999/ep/portal-common.git portal-common

[size=large][b]Other users to follow[/b][/size]
[b]1. Clone an existing remote repository to local[/b]
git clone ssh://git@cedt-icg-bitbucketcli.nam.nsroot.net:7999/ep/portal-project.git portal-project

[b]2. close submodules as well if needed[/b]
Option a: After getting into submodule folder, run 'git submodule init' and then 'git submodule update'
Option b: directly pass --recursive to the git clone command in above step
eg. git clone --recursive ssh://git@cedt-icg-bitbucketcli.nam.nsroot.net:7999/ep/reverse-proxy.git reverse-proxy

[b]Create a remote branch via local[/b]
git push -u origin 20160422_Release

Tag
git tag -a V1.0.0 -m 'tag test'
git push https://username:pwd@hostname/EsOrg/au-test7.git V1.0.0

http://digitaldrummerj.me/git-sync-fork-to-master/
1) git fetch upstream: fetch all of the changes from the original repository. Note that commits to the original repository will be stored in a local branch called, upstream/master
2) git merge upstream/master

[b]Remove latest commmit[/b]
1) git log -3 // show latest 3 commits
2) git reset --hard HEAD~1 (remove latest commit)
3) git push origin master -f

[b]Reset remote origin[/b]
git remote set-url origin https://host/orgName/repoName.git
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值