.gitignore for Chef

2015/12/15

What files might you set as being ignored by Git when using Chef ?
Here’s an idea (just talking to me, for future reference) :

.vagrant
Berksfile.lock
*~
*#
.#*
\#*#
.*.sw[a-z]
*.un~

# Bundler
Gemfile.lock
bin/*
.bundle/*

.kitchen/
.kitchen.local.yml

Advertisements

Reset Git uncommited changes

2015/09/17

Reset all changes for a subfolder for a GIT project:

git reset
git checkout .
git clean -fd

The last command cleans everything untracked, and the parameters are for:
f – cleans untracked files
d – cleans untrack directories
x – cleans ignored files (specify it ONLY if you intend that)

An alternative to the first two commands would be

git reset HEAD –hard

Note 1: Credits go to StackOverflow, IT blogs and alike, sites that helped me with the code when searching for solutions.
Note 2: Be aware that when copy-pasting, the quotes and possibly other characters get messed up by WordPress, you’ll have to replace them.


Pull all submodules changes in GIT

2015/09/16

Before getting changes from GIT server, it would be good to have the modules checked-out on the branch you’re working on:

git submodule foreach git checkout master

Pull all changes for all submodules for a GIT project:

git submodule foreach git pull origin master

Another approach that I use lately, and it’s working great:

git submodule update —-init —-remote

You could also try:

git submodule update —-recursive
git pull —-recurse-submodules

Another version that I’ve seen recently, but could not advice yet why it would be better than previous ones:

git pull —-rebase && git submodule update —-remote

After getting changes from the server, some modules might loose the check-out from the working branch, so you might need to checkout it again.

Note 1: Credits go to StackOverflow, IT blogs and alike, sites that helped me with the code when searching for solutions.
Note 2: Be aware that when copy-pasting, the quotes and possibly other characters get messed up by WordPress, you’ll have to replace them.


%d bloggers like this: