step by step guide to clone a CSC repository using vscode using SSH as transport layer.
step | comment |
---|---|
place ssh keys, private and public into your user home folder | |
.ssh is required |
|
verify user name and email | |
test connection ssh -T [email protected] |
|
a personal greeting should come back | |
navigate online to you repository | |
copy clone with SSH string | |
start vscode | |
open command palette | |
pick Git Clone command |
|
paste clone with SSH string in | |
press Enter |
|
pick a folder to clone your repo in | |
cloning in progress | |
cloning done, wanna open repo now? | |
note status bar color change | |
always be aware of active branch , bottom left , here master | |
click on master to change branch | |
prefix origin/ point to remote repo branch |
step | comment |
---|---|
open command palette by pressing <Ctrl>+<Shift>+P |
|
1 | enter git |
2 | select Git checkout to .. |
select branch | |
see even git shell has changed upstream branch 👍 |
storing large binary files in your repository will slow down performance considerable. use git lfs extension to circumvent this problem. it is very simple and transparent to use.
navigate to git lfs download and install, mirgrate
on linux it's even more simple
sudo dnf install git-lfs
inside your repo, you need to add extension, which are to be tracked by lfs.
git lfs install
git lfs track "*.png"
git lfs track "*.jpg"
git lfs track "*.jpeg"
git lfs track "*.tiff"
git lfs track "*.pdf"
git lfs track "*.7z"
git lfs track "*.tar"
git lfs track "*.gz"
git lfs track "*.xls"
git lfs track "*.xlsm"
git lfs track "*.xlsx"
git lfs track "*.doc"
git lfs track "*.docx"
git lfs track "*.vsd"
git lfs track "*.vsdx"
git lfs track "*.vss"
git lfs track "*.vssx"
git lfs track "*.ppt"
git lfs track "*.pptx"
git lfs track "*.ipynb"
git lfs track "largefiles/*.xml"
git lfs track "largefiles/*.csv"
in case you cloned repository before having git lfs installed, files tracked by lfs will not be present in your repo, only a link will be there. just enter 2 commands to fix it.
git lfs fetch
git lfs checkout
step | comment |
---|---|
open command palette by pressing <Ctrl>+<Shift>+P |
|
1 | enter git |
2 | select Git checkout to .. |
select branch | |
see even git shell has changed upstream branch 👍 |
get configuration data
step | comment |
---|---|
version | git --version |
get user name | git config --global user.name |
get email | git config --global user.email |
set configuration data
step | comment |
---|---|
user name | git config --global user.name "<your name>" |
git config --global user.email "<your email>" |
step | comment |
---|---|
chk fn | type %userprofile%\.ssh\id_rsa.pub |
gen | ssh-keygen -t rsa -C "<your email>" -b 4096 |
test | ssh -T [email protected] |
enter password phrase just once at git-bash launch,
edit line ⬇️ to ~/.bashrc
SSH_ENV=$HOME/.ssh/environment
# start the ssh-agent
function start_agent {
echo "Initializing new SSH agent..."
# spawn ssh-agent
/usr/bin/ssh-agent | sed 's/^echo/#echo/' > ${SSH_ENV}
echo succeeded
chmod 600 ${SSH_ENV}
. ${SSH_ENV} > /dev/null
/usr/bin/ssh-add
}
if [ -f "${SSH_ENV}" ]; then
. ${SSH_ENV} > /dev/null
ps -ef | grep ${SSH_AGENT_PID} | grep ssh-agent$ > /dev/null || {
start_agent;
}
else
start_agent;
fi