How do you stash an untracked file?

To stash your working directory including untracked files (especially those that are in the .gitignore) then you probably want to use this cmd: git stash –include-untracked Alternatively, you can use the shorthand -u instead of –include-untracked, or simply git stash –all which stashes all files, including untracked and ignored files. This bahaviour changed in 2018, … Read more

Throw away local commits in Git

If your excess commits are only visible to you, you can just do git reset –hard origin/<branch_name> to move back to where the origin is. This will reset the state of the repository to the previous commit, and it will discard all local changes. Doing a git revert makes new commits to remove old commits … Read more

How can I git stash a specific file?

EDIT: Since git 2.13, there is a command to save a specific path to the stash: git stash push <path>. For example: git stash push -m welcome_cart app/views/cart/welcome.thtml OLD ANSWER: You can do that using git stash –patch (or git stash -p) — you’ll enter interactive mode where you’ll be presented with each hunk that … Read more

Download a specific tag with Git

$ git clone will give you the whole repository. After the clone, you can list the tags with $ git tag -l and then checkout a specific tag: $ git checkout tags/<tag_name> Even better, checkout and create a branch (otherwise you will be on a branch named after the revision number of tag): $ git … Read more

How do I fetch all Git branches?

TL;DR answer git branch -r | grep -v ‘\->’ | sed “s,\x1B\[[0-9;]*[a-zA-Z],,g” | while read remote; do git branch –track “${remote#origin/}” “$remote”; done git fetch –all git pull –all (It seems that pull fetches all branches from all remotes, but I always fetch first just to be sure.) Run the first command only if there … Read more

Do I commit the package-lock.json file created by npm 5?

Yes, package-lock.json is intended to be checked into source control. If you’re using npm 5+, you may see this notice on the command line: created a lockfile as package-lock.json. You should commit this file. According to npm help package-lock.json: package-lock.json is automatically generated for any operations where npm modifies either the node_modules tree, or package.json. … Read more

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