PROGRAMMING

  minte9
learningjourney




S R Q

.gitignore

Often, you'll want some files to be ignored on commit.
 
#!/bin/sh

: ".gitignore 
The file contains a list of patterns to match
"

alias gs="git status | sed 's/^/\t/' ; echo"
alias gsp="git status --porcelain | sed 's/^/\t/' ; echo"

touch a.txt b.tmp
    echo "touch a b"
    gsp

echo "*.tmp" > .gitignore
    echo "*.tmp > .gitignore"
    gsp

git add .
    echo "git add ."
    gsp

git commit -qm 'm'
    echo "git commit"
    gs

git rm -q .gitignore
git rm -q a.txt
rm b.tmp 
    echo "git rm a .gitignore / rm b"
    gsp

git commit -aqm 'm'
    echo "git commit -a"
    gs
 
touch a b
    ?? main/basics/ignore/a.txt
    ?? main/basics/ignore/b.tmp

*.tmp > .gitignore
    ?? main/basics/ignore/.gitignore
    ?? main/basics/ignore/a.txt

git add .
    A  main/basics/ignore/.gitignore
    A  main/basics/ignore/a.txt

git commit
    On branch main
    nothing to commit, working tree clean

git rm a .gitignore / rm b
    D  main/basics/ignore/.gitignore
    D  main/basics/ignore/a.txt

git commit -a
    On branch main
    nothing to commit, working tree clean

Questions    
Last update: 32 days ago
Basics, Remove