博文

目前显示的是标签为“Git”的博文

Git tips

1.git rebase develop Current Branch : master ; Other Branch :  develop ; Beginning base point both master and develop :  Base_Node Other Branch develop 's last committed point: developLastPoint What does it mean to "git rebase develop" runs when the current branch is master? Hi, Git. I'm master branch. Please rebuild me base on develop. My beginning point will be developLastPoint of the branch develop . 2. git merge develop Current Branch : master ; Other Branch :  develop ; Means: Hi, Git. I'm master branch. Please make  a combination of differents of the branch develop and append it into my branch. 3. workflow 3.1 git init -> git add -> git commit 3.2 git init -> git commit -a  (equals git add -> git commit) git init: Hi git, please handle current folder. git add: Hi git, please add some files into staging area. 4.branch git branch git branch new_branch_name git branch -d will_be_deleted_branch_name git branch -D Must...

log : One Commit per Logical Change

How Often to Commit Since you can choose when to make a commit, you might be wondering how often to commit your changes. It's usually a good idea to keep commits small. As the diff between two versions gets bigger, it gets harder to understand and less useful. However, you don’t want to make your commits too small either. If you always save a commit every time you change a line of code, your history will be harder to read since it will have a huge number of commits over a short time period. A good rule of thumb is to make one commit per logical change . For example, if you fixed a typo, then fixed a bug in a separate part of the file, you should use one commit for each change since they are logically separate. If you do this, each commit will have one purpose that can be easily understood. Git allows you to write a short message explaining what was changed in each commit, and that message will be more useful if each commit has a single logical change. Commit Si...