git init
git add file-name
or unstage with
git restore --staged file-name
or revert file to it's last staged versiongit restore file-name
git commit -m 'what you have changed'you can also change your latest commit:
git commit --amend -m 'what I have changed'
Or revert a file to the latest commit:
git checkout commit-id~1 -- file1/to/restore file2/to/restore
To list all (remote and Local branches):
git branch -a
To change name of current branche:git branch -m new-name
git branch -b new-branche-name
git config --global credential.helper cacheor remove them
git config --global --unset credential.helper
…and keep original date …except the first commit. See next section for that
git rebase -r IdOfCommitX --exec 'git commit --amend --no-edit --reset-author --date="$(git log -n 1 --format=%aD)"'
git cherry-pick firstCommitID --edit git commit --allow-empty
you may have to remove some new commits created in the proccess