Git 101

From Beam Line Controls
Revision as of 15:24, 21 November 2023 by Rodolakis (talk | contribs) (Created page with "== Basic commands == === To ignore a file === <code>.gitignore</code> contains the list of file to be ignore; to ignore a new file/folder, just add it to the list using a te...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Basic commands

To ignore a file

.gitignore contains the list of file to be ignore; to ignore a new file/folder, just add it to the list using a text editor.

To commit ALL tracked files

Use option -a

$ git commit -am 'commit message goes here'   # single line message
$ git commit -am 'Message                     # multi lines message
$ 
$ goes
$ here'

To commit ONE file

$ git add myfiletocommit        # stage file for commit
$ git commit myfiletocommit    # commit file

To see the difference since last commit

$ git diff somefile

To push to remote repository

$ git push

To see the tracked files

To display files under version control:

$ git ls-files