<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://w.electrodragon.com/w/index.php?action=history&amp;feed=atom&amp;title=Category%3AGit</id>
	<title>Category:Git - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://w.electrodragon.com/w/index.php?action=history&amp;feed=atom&amp;title=Category%3AGit"/>
	<link rel="alternate" type="text/html" href="https://w.electrodragon.com/w/index.php?title=Category:Git&amp;action=history"/>
	<updated>2026-07-22T01:34:39Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.37.2</generator>
	<entry>
		<id>https://w.electrodragon.com/w/index.php?title=Category:Git&amp;diff=31357&amp;oldid=prev</id>
		<title>Chao: /* Proxy */</title>
		<link rel="alternate" type="text/html" href="https://w.electrodragon.com/w/index.php?title=Category:Git&amp;diff=31357&amp;oldid=prev"/>
		<updated>2021-05-23T12:21:18Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Proxy&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&lt;br /&gt;
== Basic Work flow ==&lt;br /&gt;
''' Init New'''&lt;br /&gt;
* Init new by git init, git add file and git commit&lt;br /&gt;
* Set a new repository on github&lt;br /&gt;
''' Add to Remote '''&lt;br /&gt;
* add local to remote service:&lt;br /&gt;
 git remote add origin https://github.com/hechao/python&lt;br /&gt;
 git remote add origin git@github.com:hechao/python.git&lt;br /&gt;
* This one is more easy and save user name and pass: '''git remote add origin https://{your name}:{you passwd}@github.com/{your name}/pmoney.git'''&lt;br /&gt;
# '''origin''' is the alias name for remote repository, here is pmoney.git, you can delete by '''git remote rm origin''', alias can be any name you like&lt;br /&gt;
# to check all alias like origin use:&lt;br /&gt;
 git remote -v&lt;br /&gt;
''' Add, Commit and log '''&lt;br /&gt;
* git add .&lt;br /&gt;
* git commit&lt;br /&gt;
* git commit -m &amp;quot;Add test.rb to test git function&amp;quot;&lt;br /&gt;
''' Git push '''&lt;br /&gt;
* after added, then add files you worked, then you can push local to remove &lt;br /&gt;
 git push -u origin master, or git pull origin master&lt;br /&gt;
#-u means remember the parameter, next time you can only use git push&lt;br /&gt;
# origin is the alias, and master means the branch&lt;br /&gt;
# git add and git commit should already be done before first push&lt;br /&gt;
&lt;br /&gt;
''' Clone or fetch '''&lt;br /&gt;
* Update to latest git update: git fetch orgin, and need to mergin the orgin to local: git merge origin/master, or use git pull origin master to do it automatically&lt;br /&gt;
&lt;br /&gt;
* git status to check if anything need to be committed&lt;br /&gt;
&lt;br /&gt;
== Operation ==&lt;br /&gt;
=== File ===&lt;br /&gt;
* touch xxx.py&lt;br /&gt;
* git add .&lt;br /&gt;
* stage the difference: git diff --staged&lt;br /&gt;
* git rm *.py or git mv&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
=== For the last change ===&lt;br /&gt;
* git reset test.py // reset to unstage the file&lt;br /&gt;
* git checkout -- test.py // undo all the check on the file since from last commit&lt;br /&gt;
* to cancel the last commit, use git commit --amend&lt;br /&gt;
&lt;br /&gt;
== Extra ==&lt;br /&gt;
''' Switch/create branch '''&lt;br /&gt;
* git branch new // create new branch&lt;br /&gt;
* git branch -d new // delete branch&lt;br /&gt;
* git checkout new // switch branch&lt;br /&gt;
== Git ==&lt;br /&gt;
* create a git on github&lt;br /&gt;
* in git gut &amp;quot;add remote&amp;quot;, enter name and web address&lt;br /&gt;
* rescan, stage, commit and push&lt;br /&gt;
== Submodule ==&lt;br /&gt;
clone all&lt;br /&gt;
* git clone --recursive https://e_dragon@bitbucket.org/e_dragon/stm32_app.git&lt;br /&gt;
clone step by step, after clone main reposirity &lt;br /&gt;
* git submodule init&lt;br /&gt;
* git submodule update&lt;br /&gt;
add&lt;br /&gt;
* git submodule add https://e_dragon@bitbucket.org/e_dragon/stm32_mylib.git&lt;br /&gt;
del&lt;br /&gt;
 git submodule deinit -f stm32_mylib&lt;br /&gt;
 git rm --cached stm32_mylib&lt;br /&gt;
update &lt;br /&gt;
* git submodule update --init --recursive&lt;br /&gt;
* git submodule update --recursive --remote&lt;br /&gt;
* git pull --recurse-submodules&lt;br /&gt;
== Config  ==&lt;br /&gt;
* If use http:// or https git clone, only need set export &lt;br /&gt;
 export http_proxy=&amp;quot;http://192.168.8.101:1081&amp;quot;&lt;br /&gt;
 export https_proxy=&amp;quot;http://192.168.8.101:1081&amp;quot;&lt;br /&gt;
* Example http clone: git clone -b openwrt-18.06 https://github.com/openwrt/openwrt.git&lt;br /&gt;
=== Global Config ===&lt;br /&gt;
* git config --global user.name edragon&lt;br /&gt;
* git config --global user.email &amp;quot;you@example.com&amp;quot;&lt;br /&gt;
=== Save password ===&lt;br /&gt;
* git config credential.helper store&lt;br /&gt;
&lt;br /&gt;
== Common Issues ==&lt;br /&gt;
save username and pass&lt;br /&gt;
* set url: git remote set-url origin git@github.com:username/repo.git&lt;br /&gt;
* git config credential.helper store&lt;br /&gt;
== Use Guide ==&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
File:Git.gif| GIF guide Bitbucket login and download&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
== Other Useful tools == &lt;br /&gt;
* torto https://tortoisegit.org/download/&lt;br /&gt;
&lt;br /&gt;
== Reference ==&lt;br /&gt;
* https://try.github.io/&lt;br /&gt;
* www.git-scm.com&lt;br /&gt;
* https://www.vagrantup.com/&lt;br /&gt;
&lt;br /&gt;
[[category: Software]]&lt;/div&gt;</summary>
		<author><name>Chao</name></author>
	</entry>
</feed>