Git Notes
Git 學習筆記。
Git Config
update personal information in: ~/.gitconfig, as below:
1 | [user] |
Clone repository from bitbucket or github
git clone https://${bitbucket or github}/${account}/${repository}.git- put a file
README.mdto gtcafe folder. git statusshows git status, you will see the unstaged files in red.git add README.md, checkgit statusagain,README.mdwill be staged status.git commit -m 'comment'commit the file to local- repeat step (2) - (5)
push the data to remote
git remote -v: list remote repositorygit remote add origin https://bitbucket.org/rick_kyhwang/gtcafe.git- list remote repository again
git push origin master: push to master branch in originoriginis an alias name, you can specify the suitable one to recoginze.
Create a branch
git branch -vshows the branch listgit branch v0.2.xcreates a branch named v0.2.xgit checkout v0.2.xswitch branch to v0.2.x- update one of files, commit
- create a new file, commit, and push:
git push orogin v0.2.x - switch to master branch
git checkout master, check the new file if existing
Create a tag
git tagshows tag listgit tag -a v0.1.xcreate a tag named v0.1.x in localgit push orogin v0.1.xpush local tag to remote
1 | # Sync the branch |



