Showing posts with label Git. Show all posts
Showing posts with label Git. Show all posts

2019-10-17

Introduction to .ignore files syntax and capabilities



------------------

You'll mostly have to look up the documentation of the .ignore files syntax if you want to master this tool and find the right tradeoff/middleground between being specific and being generic about what files you ignore in your project.

------------------

In general, you can either 1/ be specific or 2/ use wildcards or 3/ use negation patterns. For instance you could say ignore all "bin" directories, except a particular one:

```
/**/bin
!/Golum/MyPrecious/bin
```

Notice the exclamation mark at the begining of the second line: it's a negation. It means: DO NOT IGNORE.
=> Those two lines combined, will ignore all "bin" directories, wherever they are in the tree ( double asterix = means any subdirectory ) except that one particular one, named on the next line and prefixed with an exclamation mark.


------------------

But saying this I'm only scratching the surface of the power of the .ignore files, you need to look at the doc to know more. (eg. you can have a generic .ignore file at the root of the solution and, for specific cases, other .ignore file(s) in subdirector.y.ies somewhere too)

------------------

Last but not least, if you're confident with .ignore file, you can even invoke destructive commands such as "clean" and delete everything that is not under source control ( ie. that is ignored )... which is basically a prequel to REBUILD ALL.

```
# WARNING: cleans absolutely everything that is not under source control
    git clean -nfdx # << To preview what would be deleted... -n = NoAction = --dry-run
    git clean -fdx # << The actual cleanup.
```

----------------

"tfignore file - Google Search"
"https://www.google.com/search?q=tfignore+file"


For Fox

"Visual Studio 2015 TFS .tfignore file - Stack Overflow"
"https://stackoverflow.com/questions/36768954/visual-studio-2015-tfs-tfignore-file"


For Seb

Excluding Files From Team Foundation Version Control Using .tfignore Files - Applied Information Sciences
https://www.appliedis.com/excluding-files-from-team-foundation-version-control-using-tfignore-files/


For everybody

"GitHub - sirkirby/tfignore: A Collection of .tfignore Templates"
"https://github.com/sirkirby/tfignore"

"GitHub - github/gitignore: A collection of useful .gitignore templates"
"https://github.com/github/gitignore"



2019-10-16

The trend for an "Opt-out"-style philosophy for source control

The old "Opt-in"-style for source control

I remember, when using Microsoft's Team Foundation System and Visual Studio, you'd have two ways to add a file to source control:

  • either Visual Studio would take care of that for you when your file was part of a Solution
  • or you would have to manually browse the "Source Control Explorer" and add you new files


Preview of the Visual Studio's Source Control Explorer Graphical User Interface


A preview of how to explicitely add files to source control in Visual Studio




Things have changed

As far as source control goes, everybody is moving to "opt-out"-style policies, instead of "opt-in"-style ones, ( get used to it :stuck_out_tongue_winking_eye:  , 'cause it's actually much safer and nicer in the long run... even if there is an "up-front" price to pay -- ie. setting up your ".ignore" file)

Now, everything is under source control by default, unless you specify otherwise. This is nice because you typically don't get things happening behind your back without you knowing or forgetting (files added, changed or deleted).

Configuring what is ignored

When using the Git version control system, the critical files for specifying what is not meant to be kept under source control are the famous ".gitignore" files.

Visual Studio and Team Foundation System have a very similar concept, except the file is called ".tfignore".



2019-06-18

Things you will gain and things you will lose by switching from CVS to DVCS


  1. What you will gain

It's easy to make one short-lived branch per ticket.

When switching to Git, you are encouraged to use branches extensively, in fact you can/should create one branches per ticket, and merge everything back into dev (and eventually in the master branch) in one click when you finished all your work (instead merging individual “associated changesets”, which is a tedious process.)






  1. What you will lose

Central info is not supported in Git.

If you need edit binary files (eg. images, icons, etc.) or files that are famous for being hard to merge (eg. complex xml files, unfiltered log files, etc.), know that when you use a distributed version control system you will stop being aware of whether a file is currently locked for edition, or not. [This is one of the two reasons that makes Git unsuitable for game development because of all the binary assets – the other reason being that versioning binary files is not among Git’s strengths, even if the Git-LFS project kind-of bridged the gap there].



2018-06-27

Populate the "Tools" menu entry in Git GUI - Github gist


Please find GitGui-InstallTools.sh as a public Gist on Github.


It is designed to add utilities to the default Git GUI.





You might also want to configure Notepad++ to be your default editor ?

git config --global core.editor "'C:\Program Files\Notepad++\notepad++.exe' -multiInst -nosession -notabbar"