git clone
to create a local copy of a remote repository.git init
..git
will be created to track diffs, etc. git add
to place files in the
staging area.git commit -m "Commit Message"
to commit the changes.git push
. git status
to
make sure all changes have been added to the staging area. .gitignore
file to keep them out of your status output..gitignore
provides a list of specific files - or patterns
using file globs - that git should ignore.git add -f
. .gitignore
at a minimum:.*
: all hidden files*~
: temporary backups created by Emacs.DS_store
: if you ever work on Mac*.log
*.out
. git push
.git fetch
. git pull
. git remote
:git remote add origin git@github.com:user/repo.git
git push -u origin main
.git clone
. git pull
to sync local with remote,git add
, git status
, git commit
git push
main
after completing a logical chunk of work. git pull
performs a merge automatically when able.git diff
can be used to compare a file to the index (staging area)git diff
can also be used to compare two files on disk among other uses.git checkout
can be used to discard local changes and restore a file
to the version in the index. git init --bare
to initialize a bare repository.507_afs
in our AFS space.ssh user@login.itd.umich.edu
mkdir git_remotes
mkdir git_remotes/507_afs.git
cd git_remotes/507_afs.git
,git init --bare
. mkdir ~/git
,cd ~/git
.git clone /afs/umich.edu/user/u/n/unique_name/git_remotes/507_afs.git
.cd 507_afs
echo "## About" > README.md
git add README.md
git status
git commit -m "Initial commit.
git branch -m master main
git push -u origin main
git clone unique_name@login.itd.umich.edu:/afs/umich.edu/users/u/n/unique_name/git_remotes/507_afs.git
git branch <name>
.git branch
.git checkout
to switch branches.git merge
.git checkout
.git clone
to copy an existing repo.git pull
to fetch and merge changes from remote to local.git add
, git status
, git commit
to commit changes to the version
history.git push
to send your changes to the upstream remote.