Basic Git Commands - Atlassian Documentation
Basic Git Commands - Atlassian Documentation
For more detail, check out the Atlassian Git Tutorials for a visual introduction to Git commands and workflows, including examples.
Tell Git who you are Configure the author name and email address to be used with your commits. git config --global user.name "Sam Smith"
Note that Git strips some characters (for example trailing periods) from user.name.
git config --global user.email sam@example.com
Check out a repository Create a working copy of a local repository: git clone /path/to/repository
Add files Add one or more files to staging (index): git add <filename>
git add *
Commit Commit changes to head (but not yet to the remote repository): git commit -m "Commit message"
Commit any files you've added with git add, and also commit any files you've changed git commit -a
since then:
Push Send changes to the master branch of your remote repository: git push origin master
Status List the files you've changed and those you still need to add or commit: git status
Connect to a remote If you haven't connected your local repository to a remote server, add the server to be able git remote add origin <server>
repository to push to it:
1 of 2 13/02/19, 12:39
Basic Git commands - Atlassian Documentation https://confluence.atlassian.com/bitbucketserver/basic-git-co...
2 of 2 13/02/19, 12:39