db = dbHelper.getReadableDatabase(); Cursorcursor= db.rawQuery("SELECT id, name FROM people WHERE name = ? AND id = ?", newString[] {"David", "2"}); if(cursor.moveToFirst()){ do{ Stringname= cursor.getString(cursor.getColumnIndex("name")); Stringid= cursor.getString(cursor.getColumnIndex("id"));
If there were uncommitted worktree changes present when the merge started, git merge --abort will in some cases be unable to reconstruct these changes It is therefore recommended to always commit or stash your changes before running git merge.
The general rule is that you should not rewrite (change) history that you have published, because somebody might have based their work on it. If you rewrite (change) history, you would make problems with merging their changes and with updating for them.
So the solution is to create a new commit which reverts changes that you want to get rid of. You can do this using git revert command.
You have the following situation:
1
A <--B <--C <--D <--master <--HEAD
(arrows here refers to the direction of the pointer: the “parent” reference in the case of commits, the top commit in the case of branch head (branch ref), and the name of branch in the case of HEAD reference).
What you need to create is the following:
1
A <--B <--C <--D <--[(BCD)-1] <--master <--HEAD
where [(BCD)^-1] means the commit that reverts changes in commits B, C, D. Mathematics tells us that (BCD)-1 = D-1 C-1 B-1, so you can get the required situation using the following commands:
1 2 3 4
$ git revert --no-commit D $ git revert --no-commit C $ git revert --no-commit B $ git commit -m "the commit message for all of them"
Works for everything except merge commits.
Alternate solution would be to checkoutcontents of commit A, and commit this state. Also works with merge commits. Added files will not be deleted, however. If you have any local changes git stash them first:
1 2
$ git checkout -f A -- . # checkout that revision over the top of local files $ git commit -a
Then you would have the following situation:
1
A <--B <--C <--D <--A' <--master <--HEAD
The commit A’ has the same contents as commit A, but is a different commit (commit message, parents, commit date).
warning: LF will be replaced by CRLF in xx.txt 如果项目的文件是依照文件的 md5 来作为标识,那么提交代码到远程仓库,文件的行尾结束符会自动发生改变,那么之前的 md5 标识就发挥不到作用 (这样的 bug 很难找),这时候就需要取消 git 的行尾结束符自动转换功能;
set PATH=%ConEmuBaseDir%\Scripts;%PATH% set LANG=zh_CN.UTF8 set HOME=D:\w\cmder set http_proxy=http://127.0.0.1:1080 set https_proxy=http://127.0.0.1:1080
alias e.="explorer ." alias gl="git log --color --oneline --all --graph --decorate $*" alias glh="git lg | head" alias gh="git lg | head" aliasls="ls --show-control-chars -F --color=auto $*" alias ll="ls -l" aliaspwd="cd" alias clear="cls" aliasunalias="alias /d $1" alias vi="vim $*" alias cdt="cd d:/t" alias cdw="cd d:/w" alias cdc="cd d:/c" alias cdd="cd C:/Users/lilou/Desktop" alias cdwr="cd d:/w/weex/mobile" alias cdp="cd d:/w/go/src/github.com/lyloou/pugo" alias cdgo="cd d:/w/go/src/" alias vv="d:/c/Vim/vim81/gvim.exe -p --remote-tab-silent $*" alias mvnc="mvn clean -Dmaven.test.skip" alias mvncc="mvn clean compile -Dmaven.test.skip" alias mvncd="mvn clean deploy -Dmaven.test.skip" alias mvnci="mvn clean install -Dmaven.test.skip"
alias ..="cd .." alias ...="cd .. && cd .." alias www="python -m SimpleHTTPServer 8000"