Thursday, December 2, 2021

Instruct GIT not to track a specific file

Be The First To Comment

In scenarios like you have a configuration file in  a remote repo for the production environment, and you don’t want to commit the changes to this configuration file made from local. 

How do you instruct git to do not track the local changes?

--skip-worktree is what you need.

git update-index --skip-worktree <filepath/file_name>

After index update git won't show you the file in working tree.

If you want to track the changes update-index as 

git update-index --no-skip-worktree <filepath/file_name>

Monday, February 5, 2018

Git Workflow- The picture speaks for itself

Be The First To Comment

Friday, February 2, 2018

Git SSL certificate problem: self signed certificate [Solution]

Be The First To Comment
git clone https://......./data.git

throws ssl error resembling to following:
Cloning into 'data'...
fatal: unable to access 'https://*/data.git/': SSL certificate problem: self signed certificate in certifica                                                       te chain

Solution - disable sslVerify and clone it

git -c http.sslVerify=false clone https://......./data.git

Friday, November 4, 2016

Prevent local branch overwrite - Git pull origin

Be The First To Comment
  1. Reset your local master to match the remote repository's master (WARNING: be sure that you don't have any uncommitted changes you want to keep before issuing the following command):
    git reset --hard origin/master
  2. Fetch all remote branches into your local repository:
    git fetch origin
  3. Create a new local vsup12 branch from the remote vsup12 branch, and switch to this new local branch:
    git checkout -b vsup12 origin/vsup12

© 2011 GIS and Remote Sensing Tools, Tips and more .. ToS | Privacy Policy | Sitemap

About Me