<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.alikaravi.ir/index.php?action=history&amp;feed=atom&amp;title=Git</id>
	<title>Git - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.alikaravi.ir/index.php?action=history&amp;feed=atom&amp;title=Git"/>
	<link rel="alternate" type="text/html" href="https://wiki.alikaravi.ir/index.php?title=Git&amp;action=history"/>
	<updated>2026-06-22T13:46:20Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.40.1</generator>
	<entry>
		<id>https://wiki.alikaravi.ir/index.php?title=Git&amp;diff=153&amp;oldid=prev</id>
		<title>Karavi: Created page with &quot;== Git Commands ==  === 1. Setting &amp; Creating Projects === {| class=&quot;wikitable&quot; |+ ! Command !! Description |- | &lt;code&gt;git init&lt;/code&gt; || Initialize a local Git repository |- | &lt;code&gt;git clone ssh://git@github.com/[username]/[repository-name].git&lt;/code&gt; || Create a local copy of a remote repository |}  === 2. Basic Snapshotting === {| class=&quot;wikitable&quot; |+ ! Command !! Description |- | &lt;code&gt;git status&lt;/code&gt; || Check status |- | &lt;code&gt;git add [file-name.txt]&lt;/code&gt; || Ad...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.alikaravi.ir/index.php?title=Git&amp;diff=153&amp;oldid=prev"/>
		<updated>2025-11-15T05:29:23Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;== Git Commands ==  === 1. Setting &amp;amp; Creating Projects === {| class=&amp;quot;wikitable&amp;quot; |+ ! Command !! Description |- | &amp;lt;code&amp;gt;git init&amp;lt;/code&amp;gt; || Initialize a local Git repository |- | &amp;lt;code&amp;gt;git clone ssh://git@github.com/[username]/[repository-name].git&amp;lt;/code&amp;gt; || Create a local copy of a remote repository |}  === 2. Basic Snapshotting === {| class=&amp;quot;wikitable&amp;quot; |+ ! Command !! Description |- | &amp;lt;code&amp;gt;git status&amp;lt;/code&amp;gt; || Check status |- | &amp;lt;code&amp;gt;git add [file-name.txt]&amp;lt;/code&amp;gt; || Ad...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;== Git Commands ==&lt;br /&gt;
&lt;br /&gt;
=== 1. Setting &amp;amp; Creating Projects ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
! Command !! Description&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;git init&amp;lt;/code&amp;gt; || Initialize a local Git repository&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;git clone ssh://git@github.com/[username]/[repository-name].git&amp;lt;/code&amp;gt; || Create a local copy of a remote repository&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== 2. Basic Snapshotting ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
! Command !! Description&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;git status&amp;lt;/code&amp;gt; || Check status&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;git add [file-name.txt]&amp;lt;/code&amp;gt; || Add a file to the staging area&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;git add -A&amp;lt;/code&amp;gt; || Add all new and changed files to the staging area&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;git commit -m &amp;quot;[commit message]&amp;quot;&amp;lt;/code&amp;gt; || Commit changes&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;git rm -r [file-name.txt]&amp;lt;/code&amp;gt; || Remove a file (or folder)&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;git remote -v&amp;lt;/code&amp;gt; || View the remote repository of the currently working file or directory&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== 3. Branching &amp;amp; Merging ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
! Command !! Description&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;git branch&amp;lt;/code&amp;gt; || List branches (the asterisk denotes the current branch)&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;git branch -a&amp;lt;/code&amp;gt; || List all branches (local and remote)&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;git branch [branch name]&amp;lt;/code&amp;gt; || Create a new branch&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;git branch -d [branch name]&amp;lt;/code&amp;gt; || Delete a branch&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;git push origin --delete [branch name]&amp;lt;/code&amp;gt; || Delete a remote branch&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;git checkout -b [branch name]&amp;lt;/code&amp;gt; || Create a new branch and switch to it&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;git checkout -b [branch name] origin/[branch name]&amp;lt;/code&amp;gt; || Clone a remote branch and switch to it&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;git branch -m [old branch name] [new branch name]&amp;lt;/code&amp;gt; || Rename a local branch&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;git checkout [branch name]&amp;lt;/code&amp;gt; || Switch to a branch&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;git checkout -&amp;lt;/code&amp;gt; || Switch to the branch last checked out&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;git checkout -- [file-name.txt]&amp;lt;/code&amp;gt; || Discard changes to a file&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;git merge [branch name]&amp;lt;/code&amp;gt; || Merge a branch into the active branch&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;git merge [source branch] [target branch]&amp;lt;/code&amp;gt; || Merge a branch into a target branch&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;git stash&amp;lt;/code&amp;gt; || Stash changes in a dirty working directory&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;git stash clear&amp;lt;/code&amp;gt; || Remove all stashed entries&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;git stash pop&amp;lt;/code&amp;gt; || Apply latest stash to working directory&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== 4. Sharing &amp;amp; Updating Projects ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
! Command !! Description&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;git push origin [branch name]&amp;lt;/code&amp;gt; || Push a branch to your remote repository&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;git push -u origin [branch name]&amp;lt;/code&amp;gt; || Push changes to remote repository (and remember the branch)&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;git push&amp;lt;/code&amp;gt; || Push changes to remote repository (remembered branch)&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;git push origin --delete [branch name]&amp;lt;/code&amp;gt; || Delete a remote branch&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;git pull&amp;lt;/code&amp;gt; || Update local repository to the newest commit&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;git pull origin [branch name]&amp;lt;/code&amp;gt; || Pull changes from remote repository&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;git remote add origin ssh://git@github.com/[username]/[repository-name].git&amp;lt;/code&amp;gt; || Add a remote repository&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;git remote set-url origin ssh://git@github.com/[username]/[repository-name].git&amp;lt;/code&amp;gt; || Set a repository&amp;#039;s origin branch to SSH&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== 5. Inspection &amp;amp; Comparison ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
! Command !! Description&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;git log&amp;lt;/code&amp;gt; || View changes&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;git log --summary&amp;lt;/code&amp;gt; || View changes (detailed)&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;git log --oneline&amp;lt;/code&amp;gt; || View changes (briefly)&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;git diff [source branch] [target branch]&amp;lt;/code&amp;gt; || Preview changes before merging&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Karavi</name></author>
	</entry>
</feed>