Git: Difference between revisions

From Traxel Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 13: Line 13:
$ cd working-dir
$ cd working-dir
</pre>
</pre>
 
= Branch =
Make Branch and Commit
<pre>
git checkout -b experiment/css-layout
git add .
git commit -m "Experimental CSS layout changes"
git push -u origin experiment/css-layout
</pre>
Revert
<pre>
git checkout main
</pre>
diff
<pre>
git diff main..experiment/css-layout
</pre>
merge
<pre>
git merge experiment/css-layout
</pre>
</pre>
= Disable Autowreck =
= Disable Autowreck =
<pre>
<pre>

Revision as of 17:33, 28 April 2026

Repo Setup

Server Side

$ cd /path/to/repo
$ git init --bare

Client Side

$ cd /path/to/working-dir
$ cd ..
$ cp -r working-dir working-dir.bak
$ cd working-dir

Branch

Make Branch and Commit

git checkout -b experiment/css-layout
git add .
git commit -m "Experimental CSS layout changes"
git push -u origin experiment/css-layout

Revert

git checkout main

diff

git diff main..experiment/css-layout

merge

git merge experiment/css-layout

Disable Autowreck

hint: Pulling without specifying how to reconcile divergent branches is
hint: discouraged. You can squelch this message by running one of the following
hint: commands sometime before your next pull:
hint: 
hint:   git config pull.rebase false  # merge (the default strategy)
hint:   git config pull.rebase true   # rebase
hint:   git config pull.ff only       # fast-forward only
hint: 
hint: You can replace "git config" with "git config --global" to set a default
hint: preference for all repositories. You can also pass --rebase, --no-rebase,
hint: or --ff-only on the command line to override the configured default per
hint: invocation.