git init REPO
git push -u
git fetch
git pull
git pull origin branch
git merge origin/colob-branch
git status
$ git commit -a -m "MESSAGE"
# or
# git add FILE
# git commit -m "MESSAGE"
$ git push origin master
$ git branch
$ git log
git clone -b develop git@github.com:user/myproject.git
Hit the fork button on GitHub
Clone the package from your account git clone https://github.com/USERNAME/PACKAGE.git
cd PACKAGE
conda create -n test_env python=3.7
conda activate test_env
pip install -e .
git remote add upstream https://github.com/HOST/PACKAGE.git
git checkout -b shiny-new-feature
git fetch upstream
git rebase upstream/master
Do cool stuff
git commit -a -m "message"
git push origin shiny-new-feature
conda deactivate
Test the update:
conda remove --name test_env2 --all
conda create -n test_env2 python=3.7
pip install git+https://github.com/USERNAME/PACKAGE.git@shiny-new-feature
OR
$ git checkout branchname
$ git checkout upstream/master
$ git checkout -b new-branch
$ git branch -a
$ git merge main
git commit --no-verify -m "Error"
$ git remote -v
git rev-parse --show-toplevel
$ git log
$ git checkout XXXXXX
$ git checkout -b branch
git diff HEAD~N FILE > out.txt
git apply -R out.txt
git config user.name "raybellwaves"
git config user.email "rayjohnbell0@gmail.com"
git commit --amend --author="USERNAME <EMAIL@DOMAIN.com>"
q
$ git restore file
git tag
git tag -l
git describe --long --always --first-parent
git tag -a 0.0.1 -m "version 0.0.1" && git push origin 0.0.1
git tag --delete 0.0.1
git push origin --delete 0.0.1
$ git rev-list --max-parents=0 HEAD
You can then copy this into GitHub to find the date of the commit.
git commit --allow-empty -m "Empty-Commit"
GitPython
from git import Repo
repo = Repo(".")
new_version = "2022.8.14"
repo.create_tag(new_version, message="Version release")
repo.remote().push(new_version)
while true; do git pull origin main; sleep 1; done