remote server: https://github.com
username: hong-chen
name: Hong Chen
email: me@hongchen.cz
- Mandatory
git config --global user.name "Hong Chen" git config --global user.email me@hongchen.cz
- Optional
git config --global core.editor vim git config credential.helper 'cache --timeout=3600'
- Clone from existing repository on server
git clone https://github.com/hong-chen/dotfiles.git
- Initialize local directory and link it to a server repository
First go to the directory you want to initialize,
cd /Users/hchen/mygit/dotfiles
then,
git init
Then go to your git server, e.g., github, and create an emtpy new repository (no .gitignore, no README).
Create a repository named
dotfilesunder accounthong-chen. There will be a link for the repository:
https://github.com/hong-chen/dotfiles.git.
Link your local directory to the newly created repository,
git remote add origin https://github.com/hong-chen/dotfiles.git
- Before changes are made
git status git branch git branch develop-test1 git checkout develop-test1 git checkout -b develop-test2
- After changes are made
git checkout develop-test2 git add README.md git commit -m "create README.md" git pull origin develop-test2 git push -u origin develop-test2
e.g. reveal.js
git submodule add https://github.com/hakimel/reveal.js.git git submodule update --init
For example, you are at the test branch test. After testing, you want to merge the
changes made in the test into master branch.
git merge master git checkout master git merge --no-ff test