Repository Setup: Command Line - liz-miller/albiorix GitHub Wiki
UPDATE: use this configuration for command-line configuration.
- Open a terminal window and change directory to where you want the repository to be located.
- Clone the repository using this command:
$ git clone https://github.com/liz-miller/albiorix.git
- Login with your Github username and password.
- This will create a local copy of the albiorix repo.
- Type in the following command, where xxxx is the name of the branch you want to create:
$ git checkout -b xxxx
i.e. if your name is joe, use this command:
$ git checkout -b joe
-
You are now working in your branch.
-
To switch which branch you are in, use this command, where xxxx is the existing branch you want to switch to:
$ git checkout xxxx
i.e. to change back to the master branch, use this command:$ git checkout master
- Use the following command to add the filename to the repository:
$ git add <filename>
or to add a bunch of files use:$ git add *
- Commit using this command:
$ git commit -m "Commit message"
- First update your local repository by "pulling" in the newest commit
$ git pull
- Then preview your merge by comparing your source branch to your target branch
$ git diff <source_branch> <target_branch>
- Merge:
$ git merge <branch>
A built-in git GUI can be launched using the following command
$ gitk
The commit log can be accessed using this command:
$ git log