LoginSignup
2
2

More than 3 years have passed since last update.

git & github

Last updated at Posted at 2014-07-22

command

create new branch

git branch development

switch existing branch

git checkout

check current branch

git branch

[22:25:38 - 14-07-22] /Users/toripiyo/program/angularjs/logging % git branch
* development
  master

git diff

check the difference with latest commit

git diff HEAD .gitignore

check the difference commits of specific file

git diff <commit>..HEAD spec/foo.rb

prevent git from using a pager

git --no-pager log

revert specific file to specific commit

git checkout <commit> filepath

git log

show file name

git log --name-status

git reset

delete unnecessary commit

git reflog

show commit reference

git reflog

trouble shooting

error: cannot lock ref

$ git pull
error: cannot lock ref 'refs/remotes/origin/hogehoge/hugahuga': 'refs/remotes/origin/hogehoge' exists; cannot create 'refs/remotes/origin/hogehoge/hugahuga'
From github.com:Org/Repo
 ! [new branch]            hogehoge/hugahuga -> origin/hogehoge/hugahuga  (unable to update local ref)

Reason: "hogehoge" file and "hogehoge" dir can't coexist. Reflect latest remote repository info if remote repository no longer has "hogehoge" branch.

git fetch --prune

search issues by filter

  • by username and repository
    • repo:hogehoge-user-name/something-repo-name

reference

3.1 Git Branching - What a Branch Is
http://git-scm.com/book/en/Git-Branching-What-a-Branch-Is

2
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
2