User Tools

Site Tools


tech:devops:git

This is an old revision of the document!


Git Topics

Installing git-lfs on Ubuntu

  • Some basic pre-requisites:
    apt install software-properties-common
  • Set up repository:
    curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash
  • Install from repository:
    apt install git-lfs
  • Each user will need to do: git lfs install

Rename a tag

git tag new old
git tag -d old
git push origin :refs/tags/old
git push --tags

The colon in the push command removes the tag from the remote repository. If you don't do this, git will create the old tag on your machine when you pull.

Ensure that the other developers/users remove the deleted tag by running the following command:

git pull --prune --tags


Locking master branch

  • In ./git/hooks/update before section # — Config:
    	if [ "$refname" == "refs/heads/master" ]; then
    		if [ "$USER" != "<someadminuser>" ]; then
    			echo "POLICY: you are not allowed to change the master branch !"
    			exit 1
    		else
    			echo "POLICY: $USER allowed to change the master branch ..."
    		fi
    	fi
  • git config receive.denyCurrentBranch ignore
  • Edit .git/description

Misc: set active branch in bare repo: - git symbolic-ref HEAD refs/heads/thebranch


Links: Tech InfoDevops Info

tech/devops/git.1513745561.txt.gz · Last modified: 2017/12/19 22:52 by rk4n3