Yuri Panchul
git config --global user.name "Your Name"
git config --global user.email [email protected]
git config credential.helper 'cache --timeout=3600'
If you don't set it, you have to enter your username and password every time you do "git push". The timeout is set in seconds. After the timeout git will ask your username and password again. The command above sets the timeout for 10 hours.
git clone https://github.com/yuri-panchul/basics-graphics-music
git pull
git add file_or_directory_name
Note changed, added, deleted files. Note the files you intended to add but forgot to do it.
git status
git diff
Different editors treats tabs in different ways and many users do not like it. Developers should not need to configure the tab width of their text editors in order to be able to read the source code. There are some exceptions, most notably Makefiles. To find the tabs in your text files, you can use the following command:
grep -rlI --exclude-dir=.git --exclude=*.mk $'\t' .
The meaning of the grep options:
- -r - recursive
- -l - file list
- -I - Ignore binary files
You can fix the tabs by doing the following, but make sure to review the fixes:
grep -rlI --exclude-dir=.git --exclude=*.mk $'\t' . | xargs sed -i 's/\t/ /g'
git checkout file_or_directory_name
2.8. If you want to undo uncommitted changes for all files in the current directory, including uncommitted deletions, use this command:
git checkout .
2.9. If you want to undo any commited changes or even pushed changes, ask some power git user or read the git documentation carefully, making sure you understand everything.
Note that -a option automatically stages all modifications and file deletions, but not the additions. You need to use 'git add' to add files or directories explicitly.
Important Note 1: Please run "git status" and "git diff" before any commit. Undoing committed and especially pushed changes is more difficult than undoing uncommitted changes.
Important Note 2: Please put a meaningful comment for each commit.
git commit -a -m "A meaningful comment"
Now everybody can see your changes.
git push
3.1. You can browse the repository history on http://github.com itself using web browser interface
Such files may include automatically generated binaries, temporaries, or unrelated files you don't want to checkin or to appear in git status. Please read about .gitignore in Git documentation before doing it.
git clean -d -n
This command works from the current directory all the way down.
After reviewing (be careful!), you can remove the files by running:
git clean -d -f
To keep things clean, periodically remove files in the tree, ignored by git based on .gitignore list. You definitely need to remove them before preparing a release package.
git clean -d -x -n
After reviewing (be careful!), you can remove the files by running:
git clean -d -x -f
3.5. If you need to do anything non-trivial (merging, undoing committed or pushed changes), please carefully consult Git documentation.
Otherwise you may introduce mess, bugs, or checkin some large binary files polluting the repository.
Updated on 2023.09.16