How can I save username and password in Git?

Attention: This method saves the credentials in plaintext on your PC’s disk. Everyone on your computer can access it, e.g. malicious NPM modules. Run git config –global credential.helper store then git pull provide a username and password and those details will then be remembered later. The credentials are stored in a file on the disk, … Read more

Pull latest changes for all git submodules

If it’s the first time you check-out a repo you need to use –init first: git submodule update –init –recursive For git 1.8.2 or above, the option –remote was added to support updating to latest tips of remote branches: git submodule update –recursive –remote This has the added benefit of respecting any “non default” branches … Read more

Make .gitignore ignore everything except a few files

An optional prefix ! which negates the pattern; any matching file excluded by a previous pattern will become included again. If a negated pattern matches, this will override lower precedence patterns sources. # Ignore everything * # But not these files… !.gitignore !script.pl !template.latex # etc… # …even if they are in subdirectories !*/ # … Read more

How do I delete a file from a Git repository?

Use git rm. If you want to remove the file from the Git repository and the filesystem, use: git rm file1.txt git commit -m “remove file1.txt” But if you want to remove the file only from the Git repository and not remove it from the filesystem, use: git rm –cached file1.txt git commit -m “remove … Read more

How do I delete all Git branches which have been merged?

NOTE: You can add other branches to exclude like master and dev if your workflow has those as a possible ancestor. Usually I branch off of a “sprint-start” tag and master, dev and qa are not ancestors. First, list locally-tracking branches that were merged in remote (consider using -r flag to list all remote-tracking branches). … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)