Git commnets




 git commands:

----------------------------


>git status .


To know diff old patch and new 

>git diff nv_memory_driver/ftl/src/ftl_test_interface.c

To create the branch with UTP

>bee startsms . <UTP Name>

>bee startsms .

ADD:

=====


git add -A --> stages All

git add .  --> stages new and modified, without deleteds

git add -u --> stages modified and deleted, without new

diff:

=====

git diff <file>

git diff --staged 

git diff --check --> for checking the white space error


search

======

> grep -rnsi 

git diff at_router/src/at_router.c

grep -rnis "PCL_PAD_I2C1_SCL" board_fih* | grep 125 

clean: untracked files

======

git clean -f -d or git clean -fd  ------------------------->  To remove directories

git clean -f -X or git clean -fX  ------------------------->  To remove ignored files

log:

git log --author=="kponnojx"

 

amend:

=====

bee commit --amend .   

rename:

=======

git mv <old_name> <new name>

git mv <old_name> <directory/new_name>


checkout:

========= 


git checkout -- <filename>

git checkout -- at_router/src/at_router.c 


bee forall -p 'git reset --hard M2_7360_01.1723_DB07'

git reset --hard M2_7360_01.1723_DB07

commit;

=======

bee commit .

upload:

=======

bee upload .


dos to unix conv

================

dos2unix mhw_drv_src/core_drivers/inc/board_fbc_7260_v2_lc_rev_1_0/pcl_driverif_cfg.h

file <filename>

git apply --check --whitespace=fix pcl.patch

git apply --reject --whitespace=fix pcl.patch

bee commit --amend .

bee upload .

bee commit .

        bee upload .

GIT:

$ git commit : to commit changes

$ git branch name : to create a branch

$ git checkout name : to checkout a branch

$ git merge name : To merge new branch with current brach

$ git rebase name : To goto the new commit label


git config color.diff.whitespace "red reverse"


while using bee sync -j32 if we get any error..


simplely go to that directory 

git status.

it will show list of untraced files.

git checkout -- (space) <filename>


then bee sync -j32 

/mhw_drv_inc/inc/sensor/sensor_bootcore.h


find -iname "rpcu_shim_xg746_reg.h"


grep -Rn "name"



set num



after cherry pick the changes verify with "git log " commads



for create a path 


 git add .

 

 git commit .

 

 git format-patch -1

 

 git reset --hard HEAD^1   --> 1 head will be removed

 

 git reset --hard <commit id>

 

 git apply --reject --whitespace=fix  <patch>

 

 

 

 ------------------

 

 create Dummy gerrit 

create brach ( using bee startsms ) and switch to it

check white space

git add .

bee commit --amend .  ( if want to creat new patch on same gerrit link )

bee commit .

bee upload . --> if asked for track, give yes .

-----------------------------------------------------

merget to 2 commit


git format-patch <latest_commit>

git reset --hard <latest_commit>

git log 

patch -p1 < your.patch

git status

---------------------

rebase with new ws


   115  19:07   mkdir CMM_Coverag

   116  19:08   cd CMM_Coverag/

   117  19:09   bee init -b rel12/development

   118  19:09   bee sync -j32 /modem/infra_layer/core

   119  19:10   bee sync -j32 modem/infra_layer/core

   120  19:10   clear

   121  19:10   cd platform_sw/infra_layer/core/

   122  19:10   git log

   123  19:10   clear

   124  19:12   git fetch ssh://kponnojx@opticm6/modem/infra_layer/core refs/changes/52/456852/7 && git format-patch -1 FETCH_HEAD

   125  19:12   git apply --reject 0001-Inconsistency-CMM-Code-Coverage.patch

   126  19:12   git status

   127  19:12   vim test/adapter/dma/target/dma_gti.c.rej

   128  19:13   vim test/adapter/dma/target/dma_gti.c

   129  19:14   git status

   130  19:14   git diff test/adapter/dma/target/dma_gti.c

   131  19:15   rm -rf 0001-Inconsistency-CMM-Code-Coverage.patch

   132  19:15   rm -rf test/adapter/dma/target/dma_gti.c.rej

   133  19:15   git status

   134  19:15   git diff test/adapter/dma/target/dma_gti.c

   135  19:15   git add .

   136  19:15   git status

   137  19:15   bee commit .

   138  19:16   git branch CMM_Coverage

   139  19:17   git branch

   140  19:17   git checkout CMM_Coverage

   141  19:17   git status

   142  19:17   bee commit .

   143  19:19   bee track CMM_Coverage

   144  19:19   bee upload .

   145  20:26   history



------------------------

gitk <file>--> 


git commit --> will not create path on old gerrit link

bee commit --> will create patch on old gerrit link


git log <file>





------------------------------------------


git diff > my_file_name.diff 


git diff > <patch_name.patch>





--------------------


merge confclits


git diff <file>


vim <file>


git add

 

git cherrrpick --continue





-------------------------------------------------



git show a8359ee23b35fcc55bab3adb93914f51b5e4e91e

git format-patch -1 HEAD --stdout > 0001-last-commits.patch

vim 0001-last-commits.patch

git reset --hard HEAD^1 

patch -p1 < 0001-last-commits.patch 




 patch -p1  --dry-run </local/kponnojx/diff/0001-last-commits.patch 

 

 

 

---------------------------------------------------------


dummy gerrit



1. bee sync

2. git branch

3. git cherry-pick  --> cherry-pick  chanage from the gerrit

4. git status (if u got merge confclits edit the file and added  )

5. vim test/service/cmm/target/cmm_test_interface.c

6. git add test/service/cmm/target/cmm_test_interface.c

7. git cherry-pick --continue

8. git log

9. patch -p1 </local/kponnojx/diff/0001-last-commits.patch

10.git status 

11.git add .

12.git status

13.bee commit --amend .  (will create new patch on top off the previous patch and add patch info)

14.bee upload

15. after few minture will get notification 







git branch

  430  git reset --hard HEAD^1

  431  git log

  432  clear

  433  git fetch ssh://kponnojx@opticm6/modem/infra_layer/core refs/changes/07/471407/5 && git cherry-pick FETCH_HEAD

  434  git status

  435  vim test/service/cmm/target/cmm_test_interface.c

  436  git add test/service/cmm/target/cmm_test_interface.c

  437  git cherry-pick --continue

  438  git log

  439  patch -p1 </local/kponnojx/diff/0001-last-commits.patch 

  440  git status

  441  git add .

  442  git status

  443  bee commit --amend .

  444  bee upload  

  

  

 git blame <file_name> -> to find each line modification history


 git show --check --> to check whitespace in the commit  

 

 

    455  14:57   git log

   456  14:58   git checkout f735ba95dbf7e1b5b59521e44c3c238a4a076efa -- adapter/system_adapter/src/modem/core_os.c

   457  14:58   git status

   458  14:59   git reset HEAD adapter/system_adapter/src/modem/core_os.c

   459  14:59   git status

   460  14:59   git diff

   461  14:59   clear

   462  15:01   git checkout f735ba95dbf7e1b5b59521e44c3c238a4a076efa interface/service/cmm/uta_cmm.h

   463  15:01   git status

   464  15:01   git clean -fd

   465  15:01   git status

   466  15:01   git reset HEAD interface/service/cmm/uta_cmm.h

   467  15:02   git status

   468  15:02   git diff

   469  15:02   git diff --check


   

 git diff mybranch rel12/development ---> list of changes with the original repo

 

 

 git diff <previous_commet> .  -> compare the cherr-pick(with local changes)

 

 git apply --check --whitespace=fix <patch file> //to check if patch can be applied

git apply --reject --whitespace=fix <patch file> //to apply patch and reject hunks which cant be applied 


Git Publick Kery Gen:

ssh -V

ssh-keygen -t ed25519 -C "<comment>

Patch:
    create patch:
diff -u OriginalFile UpdatedFile > PatchFile
diff -ru Original_directory Updated_directory  > File
apply patch:
patch foo.c < patch.diff
create patch:
diff -u OriginalFileOriginalFile UpdatedFile > PatchFile
diff -ru Original_directory Updated_directory  > File
apply patch:
patch foo.c < patch.diff

Comments

Popular posts from this blog

Cryptography and Encryption Basics - I

Overview of ISO/SAE 21434 Standard

UDS Protocol Interview Question