Difference between revisions of "GIT"

From eLinux.org
Jump to: navigation, search
(Created page with "=== 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=oneli...")
 
(Git Commands :)
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
=== Git Commands : ===
 
=== Git Commands : ===
  
git diff
+
    git diff
git add
 
git commit -s -v
 
git format-patch LAST_LOCAL_COMMIT_ID
 
  
git show HEAD
+
    git add
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 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
 +
 
 +
<sub>
 +
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.
 +
</sub>
 +
 
 +
* 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

Latest revision as of 14:37, 17 October 2017

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