Skip to content

Instantly share code, notes, and snippets.

@gyliu513
Last active January 4, 2017 09:19
Show Gist options
  • Save gyliu513/4855a8db0ed3bcf062213c9aa7c270f6 to your computer and use it in GitHub Desktop.
Save gyliu513/4855a8db0ed3bcf062213c9aa7c270f6 to your computer and use it in GitHub Desktop.
https://github.com/kubernetes/community/blob/master/contributors/devel/development.md
KUBE_ENABLE_CLUSTER_DNS=true
KUBE_DNS_SERVER_IP="10.0.0.10"
KUBE_DNS_DOMAIN="cluster.local"
./hack/local-up-cluster.sh -O
git remote add upstream https://github.com/kubernetes/community
111 git fetch upstream
112 git checkout -b patch1 upstream/master
113 ls
114 git status
115 vim contributors/devel/testing.md
116 git status
117 git add .
118 git commit -a
119 git branch -a
120 git push origin patch1
121 git push origin :test << delete
root@k8s004:~/gyliu/community# git pull
Already up-to-date.
root@k8s004:~/gyliu/community# git fetch upstream
root@k8s004:~/gyliu/community# git rebase upstream/master
Current branch master is up to date.
Clone your fork
The commands below require that you have $GOPATH set ($GOPATH docs). We highly recommend you put Kubernetes' code into your GOPATH. Note: the commands below will not work if there is more than one directory in your $GOPATH.
mkdir -p $GOPATH/src/k8s.io
cd $GOPATH/src/k8s.io
git clone https://github.com/gyliu513/kubernetes.git
cd kubernetes
git remote add upstream 'https://github.com/kubernetes/kubernetes.git'
git fetch upstream
git rebase upstream/master
git checkout -b patch1 upstream/master
git push -f origin patch1
git push origin :patch1
git checkout -b my-feature
# Make your code changes
Keeping your development fork in sync
git fetch upstream
git rebase upstream/master
Note: If you have write access to the main repository at github.com/kubernetes/kubernetes, you should modify your git configuration so that you can't accidentally push to upstream:
git remote set-url --push upstream no_push
Committing changes to your fork
Before committing any changes, please link/copy the pre-commit hook into your .git directory. This will keep you from accidentally committing non-gofmt'd Go code. This hook will also do a build and test whether documentation generation scripts need to be executed.
The hook requires both Godep and etcd on your PATH.
cd kubernetes/.git/hooks/
ln -s ../../hooks/pre-commit .
Then you can commit your changes and push them to your fork:
git commit
git push -f origin my-feature
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment