- 🔗Build a connect from Local to Remote
- 📖Clone repo from Remote to Local
- 💡Some little tip about git
-
- Creat a directory and name it anything you want
-
- Enter the cmd window and run this command
git init
-
- Create a file or move code file in it, then add all this to buffer zone
touch test.txt
git add .
-
- Then make a commit to my local repo
git commit -m "xxxx" xxxx is the remark to the change
-
- Add the remote repo and name it, then use [-v] to check the detail
git remote add origin [URL]
git remote -v
ATTENTION!!! always use origin as the name of repo
-
- Get the remote repo information and check the branch
git fetch origin
git branch -a
-
- Make a tracking branch as prepare work
git branch -u origin/master master
---the first param is remote while the second is local---
git branch -vv [check the tracking information]
-
- Then pull the repo to update branch
git pull --allow-unrelated-histories
-
- At last directly push the commit the remote repo (Since tracking has been set in step 7)
git push
-
- 🤩 It can be checked on the repo commit column
-
- Creat a directory and name it anything you want
-
- Enter the cmd window and run this command
git clone [URL]
It will creat a .git directory with git configure in secret, and initialize it at the same time
-
- Then the repo can be successfully download
- 1.1 Create a new branch
git branch [branch_name]
- 1.2 Switch to the branch
git checkout [branch_name]
- 1.3 Create a new branch and switch to it
git checkout -b [branch_name]
- 1.4 Merge the dev branch to the master branch
git checkout master
git merge dev
fatal: unable to access 'https://github.com/xxxx':
Failed to connect to github.com port 443 after 21039 ms:
Could not connect to server
-
- Disable the ssl verification (not recommended)
git config --global http.sslVerify false
-
- Find the process that occupies the port 443 and kill it
netstat -ano | findstr 443
taskkill /F /PID [PID]
or batch operation
for /f "tokens=5" %a in ('netstat -aon ^| findstr "443"') do taskkill /F /PID %a
fatal: unable to access 'https://github.com/Linncharm/xxxxxx':
Failed to connect to github.com port 443 after 21097 ms: Could not connect to server
-
- Cancel the http/https proxy setting of git
git config --global --unset http.proxy
git config --global --unset https.proxy
git config --global http.proxy http://127.0.0.1:4780