Git
https://wexlergroup.github.io/git-recite-slides/
2024-08-29
Version control (also known as revision control, source control, and source code management) is the software engineering practice of controlling computer files and versions of files; primarily source code text files, but generally any type of file. 1
Git
is a softwareGit
There are the local parts and the server part. Typically, you interact with all parts through the command line interface (CLI), which contains a set of text-based instructions.
Nowadays, there are graphical user interfaces (GUIs) available for your convenience. Many integrated development environments (IDEs) also have integrated git functionalities, either built-in ot via plug-ins.
pull
Repo: repository
push
Repo: repository
wexlergroup/FreeBird.jl
? A server? A project? A software?wexlergroup/FreeBird.jl
hosted?FreeBird
, or it is just simply the perfection😁?git clone
: copy, or “clone” a repo from a server
I recommend creating a new repo on GitHub then clone it, instead of initiating a repo locally then push. See Creating a new repository page on GitHub.
git init
: tell git to set up version controlOr, when outside a directory, use
- Directory: a “folder” equivalent in CLI
git config
Setting up for every repository on your computer
Setting up for a single repository on your computer
git pull
: you pull the updates from the serverAlways try pull
before making any changes to stay up-to-date with the origin, and avoid merge conflicts.
git status
: check the status of the current repogit status
On branch main
Your branch is up to date with 'origin/main'.
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git restore <file>..." to discard changes in working directory)
modified: docs/index.html
modified: index.qmd
no changes added to commit (use "git add" and/or "git commit -a")
git add
: to stage the changesseveral options:
git commit
: to commit the changes staged with git add
git push
: to push
your changes to the origin
git push
Enumerating objects: 9, done.
Counting objects: 100% (9/9), done.
Delta compression using up to 8 threads
Compressing objects: 100% (5/5), done.
Writing objects: 100% (5/5), 1002 bytes | 1002.00 KiB/s, done.
Total 5 (delta 3), reused 0 (delta 0), pack-reused 0
remote: Resolving deltas: 100% (3/3), completed with 3 local objects.
To https://github.com/yangmr04/git-recite-slides.git
5786288..efbbf37 main -> main
Merge conflicts occur when competing changes are made to the same line of a file.1 It will block the push
actions until the conflicts are resolved. A merge conflict looks like this:
Start using it, now!