-
-
Notifications
You must be signed in to change notification settings - Fork 7
git basics
dinglewanker edited this page Aug 22, 2020
·
2 revisions
The folowing commands will set your username and account for git.
git config --global user.name "<Your username here>"
git config --global user.email "<Your email here>"
These next command will set the cache time for your git. This is so you don't have to keep logining into github each time you do a push or pull.
git config --global credential.helper cache
git config --global credential.helper 'cache --timeout=9999999'
Running the following command will show you which files have changed and if you have created new files that are not in the repo.
git status
To put your changes (or new files) back into github first do a git add
git add <file>
Do this for all the files you want to be commited back to github.
Then to commit and push your changes by doing the following.
git commit -m "<your commit message here>"
git push
To get changes from another user (after you have already done git clone) you will need to do a git pull.
git pull
To undo a git add do a git reset like this
git reset <filename>
To undo all file changes. do the following.
git reset -hard