From 8841564ed7d2bda26dc965e0d19b708296d0805c Mon Sep 17 00:00:00 2001 From: Hao Wu <haowu@haowu.me> Date: Wed, 6 May 2015 17:12:42 -0500 Subject: [PATCH] added doc for tools, finished git tutorial --- git_intro.md | 40 +++++++++++++++++++++------------------- tools.md | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 67 insertions(+), 19 deletions(-) create mode 100644 tools.md diff --git a/git_intro.md b/git_intro.md index fab34f5..b1831b1 100644 --- a/git_intro.md +++ b/git_intro.md @@ -1,15 +1,5 @@ # Git(and Gitlab) Tutorial for Cogcomp -<!-- -TODO list: -tagging and version control -when to tag/release -writing good commit messages -squashing commits -when to push to master -git and Intellij -issues - --> ##### Prerequisite: This is Git/Gitlab tutorial for Cogcomp, we assumes that you have already knows the basic things about Git and version control. @@ -20,7 +10,7 @@ If you are not familiar with concepts. There are many interactive git tutorial y * [Git - the Simple Guide](http://rogerdudler.github.io/git-guide/) A very simple guide that covers all the basic things. * [Pro Git](http://git-scm.com/book/en/v2) The most comprehensive tutorial you can found. * [Git Ready](http://gitready.com/) - +* [Git Best Practices](https://sethrobertson.github.io/GitBestPractices/) A list of rules to follow. ## Git tutorial @@ -36,6 +26,15 @@ Please make sure that you can answer the following questions: If you can not answer ***all*** the question above, you should go back to the basic git tutorials listed in **Prerequisite** section. +### Important thing: + +There are a couple very import things to remember when using git. + +* Do read about it. +* Use `gitignore`. +* Avoid binary files. +* Many other tips in [Git Best Practices](https://sethrobertson.github.io/GitBestPractices/) + ### Some tricks: #### Git alias @@ -56,7 +55,6 @@ the 1b2e1d63ff stands for the first 10 characters of the commit id you want to r ### Commit messages (How to write good commit messages) -Many developers have discussion ([example](http://stackoverflow.com/questions/2290016/git-commit-messages-50-72-formatting)), #### When to commit @@ -66,17 +64,21 @@ Ideally, you should commit once you finished one single basic features. So you c WHen you are happy with all your new commits, you will be ready to push. Once you push your commits, they will be available online. - - #### Writing good commit message -A good commit message should +Many developers have discussion ([example](http://stackoverflow.com/questions/2290016/git-commit-messages-50-72-formatting)). Click the above link to view the discussion. +A good commit message should contains a sentence described what you did in this commit. A good commit message normally contains 50-120 characters. #### Split commit message -#### Squashing commit message +Use `git rebase --interactive` to edit that earlier commit, run `git reset HEAD~`, and then git add -p to add some, then make a commit, then add some more and make another commit, as many times as you like. When you're done, run git rebase --continue, and you'll have all the split commits earlier in your stack. + +Important: Note that you can play around and make all the changes you want, and not have to worry about losing old changes, because you can always run git reflog to find the point in your project that contains the changes you want, (let's call it a8c4ab), and then git reset a8c4ab. +#### Squashing commit message +Similarly, `git rebase --interactive` can also used to combine multiple commits, `git reset HEAD~10` will reset the head to 10 previous commits. + ## Gitlab ### Access Control @@ -99,7 +101,7 @@ Deployment key is per-project based, and gives you read-only access. Markdown is a markup language with plain text formatting syntax designed so that it can be converted to HTML and many other formats using a tool by the same name. Markdown is often used to format readme files, for writing messages in online discussion forums, and to create rich text using a plain text editor. -For example, this document is also written in Markdown. +For example, this document is also written in Markdown. I personally use **sublime text** + **Marked** to write and view Markdown documents, but there are other options, for example [Stackedit](https://stackedit.io/) ##### Markdown Tutorial @@ -120,9 +122,9 @@ For a list of Git Snippets, you can visit here: ### Issues -Issues are a great way to keep track of tasks, enhancements, and bugs for your projects. They’re kind of like email—except they can be shared and discussed with the rest of your team. Most software projects have a bug tracker of some kind. GitHub’s tracker is called Issues, and has its own section in every repository. +Issues are a great way to keep track of tasks, enhancements, and bugs for your projects. They are kind of like email—except they can be shared and discussed with the rest of your team. Most software projects have a bug tracker of some kind. GitHub’s tracker is called Issues, and has its own section in every repository. -Additional to this, you can also use it as a TODO lists. +Additional to this, you can also use it as a TODO lists. So there is no need to create a file called *todo* anymore. And when you done with one issues, just mark them as closed. Issues are per-project based, so you visit the issue page of your project using this URL: diff --git a/tools.md b/tools.md new file mode 100644 index 0000000..6604e4a --- /dev/null +++ b/tools.md @@ -0,0 +1,46 @@ +# Tools for writing software and etc. + +This is a collection of tools that I found very useful for developing softwares. + +(This is a unordered list) + +And I am not trying to argue which editor is the best editor, X is better than Y. The list only reflects my personal choices about the tools I used. + +## Learn the tools: + +**Learn to use whatever tools you pick**, many tools are design for programmers and are neither easy nor straightforward. However, invest your time and you will benefit a lot from it, otherwise it may even slow you down. + + +## Maven + +No need to introduce, you ***must*** use it(or similar things) to manage dependencies. Never download/import jar files manually. + +There is a nice maven tutorial on CCG Wiki. (need link here.) + +## Sublime Text +Sublime text is a very good general purpose editor, with many plugin available. I use it for almost everything other than coding. + +Some nice features you shouldn't missed: + + * Multi-cursor support + * alignment plugin + * text pastry <- want to insert sequential number into many places? + +Use those features together allow you to accomplish many complicated tasks in a few seconds. (for example, adding sequential ID number to 1000 xml nodes.) + +[Here is a free video tutorial](http://code.tutsplus.com/courses/perfect-workflow-in-sublime-text-2) + +Also, you don't really need to pay for it if you can tolerate the pop-up windows. + +## Intellij Idea + +Intellij idea is a Integrated development environment, which provides the following features: + +* great out-of-box support for maven, sbt, and many other tools. +* Smart code suggestion and re-formating +* Many complicate re-factoring tools: extract variable/methods, renaming. + +It is a $200 software, but it have a free education license, which is great. + +## Sequal Pro (only on Mac) +Nice Mysql GUI for Mac. \ No newline at end of file -- GitLab