git general commands

  • How to bind your local git account to remote git account?

Ensure local git email address similar to remote github git email address.


$ git config --global user.email ivanopt1102@gmail.com ;

  • When i add a new folder to the existed program, it shows that :
[sourcoecde]

Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)
(commit or discard the untracked or modified content in submodules)

modified: hive-java-client (modified content, untracked content)

no changes added to commit (use "git add" and/or "git commit -a")

[/sourcecode]

solution :

$ git rm -rf --cached hive-java-client
  •  git remote add/set-url

(1) add url :

$ git remote add origin git@git.dev.ivan.com:ivan/java.git
$ git push -u origin master

(2) set url

$ git remote set-url origin git://new.url.here
  • To show author commit messages by advanced methods.  (The author, also with date)

ivan@ivan git log --oneline -5 --author ivan --before "Fri Mar 26 2015"

  • To see the commits by the developer in glance (also show the number of  commits done)

ivan@ivan git shortlog --author ivan

ivan (678):

      Rename parent name.

      Read ip/port from properties.

      Refactor StatsDClientBean & add PostConstruct.

 

  • Git commit rules, thanks to my partner Ming.

http://chris.beams.io/posts/git-commit/#capitalize

 

Posted in

发表评论

电子邮件地址不会被公开。 必填项已用*标注

您可以使用这些HTML标签和属性: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>