GIT Useful tips

GIT Commands:


Renaming Branch:

** Rename branch locally to the new name
     git branch -m old_branch_name new_branch_name

** Delete the old branch on remote. Where <remote> is like origin
     git push <remote> :old_name

     Eg: git push origin :old_branch


** Push the new branch to remote         

    git push --set-upstream <remote> new_name

    Eg: git push --set-upstream origin new_branch





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

GIT Push issues:


Symptoms :


While pushing the file to GIT repository, facing issues like "insufficient permissions" while using "git push" command with below errors.

Counting objects: 3, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (2/2), done.
Writing objects: 100% (3/3), 312 bytes | 0 bytes/s, done.
Total 3 (delta 1), reused 0 (delta 0)
remote: error: insufficient permission for adding an object to repository database ./objects
remote: fatal: failed to write object
error: unpack failed: unpack-objects abnormal exit



Solution:



To resolve this issue, follow below steps:

- login into GIT remote server using git installed user (super user) (where the GIT server has been hosted)
- Chnage the directory to the gitrepository location of your repository
  cd <path to your-repository.git>
- Change the group permissions of all directories and sub directeries of your repository as follows
sudo chmod -R g+ws *

- After this chnage try to push the committed changes from local machine

Comments

Popular posts from this blog

Weblogic 12c & Apache 2.4 troubleshooting

Enabling WL-Proxy-SSL HTTP header in WebLogic