Description | Command | Reference |
---|---|---|
Store credentials | git config credential.helper store | |
Allow no comment on commit | git config --global alias.nccommit 'commit -a --allow-empty-message -m ""' | Source |
Undo a commit | git reset HEAD~ | |
List remotes | git remote -v | |
Change remote | git remote set-url origin <URL> | Reference |
Append to last commit | git commit --amend |
create a new repository that has the initial commit that you want
mkdir foo; cd foo; git init; ...; git commit
set up a remote
git remote add origin <url-of-remote>
git branch --set-upstream master origin/master
push your new history
`git push -f``
delete obsolete remote branches
git push origin :deprecated-branch
git fetch origin
git reset --hard origin/master
Add the remote, call it "upstream":
git remote add upstream https://github.com/whoever/whatever.git
Fetch all the branches of that remote into remote-tracking branches, such as upstream/master:
git fetch upstream
Make sure that you're on your master branch:
git checkout master
Rewrite your master branch so that any commits of yours that aren't already in upstream/master are replayed on top of that other branch:
git rebase upstream/master
libsecret
and gnome-keyring
(seahorse
for GUI)git config --global credential.helper libsecret
gnupg
https://raw.githubusercontent.com/git/git/master/contrib/credential/netrc/git-credential-netrc
/usr/share/git/credential/netrc/git-credential-netrc
/usr/share/doc/git/contrib/credential/netrc/git-credential-netrc
~/.netrc
):
machine github.com
protocol <http|https|ssh>
login <username>
password <password>
gpg --gen-key
gpg -e -r <email> ~/.netrc
git config --global credential.helper "netrc -f ~/.netrc -v"
git-credentials-
prefix will be automatically prepended to form git-credentials-netrc
-d
for debugginggit-credentials-netrc --help
git lfs migrate import --include="*.mp4" --include-ref=refs/heads/master
git push --force
git lfs ls-files
git lfs install
git lfs pull