Here are some notes I took and I like to refer to.
Last update: March 5th, 2020
The GitHub repo has already been initialized and the local and remote branches are in sync.
git add .
git status
git commit -m "Commit comment"
git push origin master
git init
git add <option>
<.>
everything in the current directory, same as --all
or -A
<file>
all changes in file.<directory>
all changes in the target directory.<-p>
interactive staging, let you choose files one by one.git commit -m "First commit message"
git remote add origin https://.../your-repo.git
git push -u origin master
<-u>
will remember your preferences for remote and branch and you can simply use the command git push
next time.git config --global user.name "FIRST_NAME LAST_NAME"
git config --global user.email "MY_NAME@example.com"
<--global>
if it’s for every repo, dont use it if it’s for a specific repo.Display configuration file:
*cat .git/config
git remote -v
to list the existing remotes and see their names and URLs
git remote set-url
followed by the remote name and URL:
git remote set-url origin git@gitserver.com:user/repo_name.git
.git/config
file with a new URL to the remote repository.git remote -v
If your local branch is behind the remote master:
git checkout [master/main]
git pull
git checkout [my-branch-which-is-behind]
git merge master
Git will ask for a commit message.
Last update: May 27th, 2020
Official documentation.
python3 -m venv /path/.../venv
source ./venv/bin/activate
deactivate
pip3 freeze
pip install <package name>