GIT

From eLinux.org
Jump to: navigation, search

Git Commands :

    git diff
    git add
    git commit -s -v
    git format-patch LAST_LOCAL_COMMIT_ID
    git show HEAD
    git log --pretty=oneline --abbrev-commit
    git show --pretty=oneline --abbrev-commit HEAD
    git show HEAD | perl scripts/get_maintainer.pl --separator , --nokeywords --nogit --nogit-fallback --norolestats --nol
    perl scripts/get_maintainer.pl --separator , --nokeywords --nogit --nogit-fallback --norolestats --nol -f drivers/staging/most/aim-sound/sound.c
    git format-patch -o /tmp/ HEAD^
    git format-patch master --stdout > fix_empty_poster.patch

This will create a new file fix_empty_poster.patch with all changes from the current (fix_empty_poster) against master. Normally, git would create a separate patch file for each commit, but that’s not what we want. All we need is a single patch file.

  • Command to modify/update old commit id :
    $ git rebase -i HEAD~3    - https://help.github.com/articles/changing-a-commit-message/
  • How to push any modify commit in above step :
    $ git commit --amend -as
    $ git push --no-thin  ssh://antu:22418/kernel/4.4 HEAD:refs/for/4.4