Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revisionBoth sides next revision | ||
linux:git [2019/05/24 13:03] – mh | linux:git [2019/10/05 19:31] – [Atom, Git and Rust] mh | ||
---|---|---|---|
Line 11: | Line 11: | ||
< | < | ||
git add the.file | git add the.file | ||
+ | git commit -m "The message" | ||
+ | git push | ||
+ | </ | ||
+ | |||
+ | ==== Branches ==== | ||
+ | |||
+ | Switch branch (option create) | ||
+ | < | ||
+ | git checkout branch_name | ||
+ | git checkout -b create_branch_name | ||
+ | </ | ||
==== Atom, Git and Rust ==== | ==== Atom, Git and Rust ==== | ||
- | I need to write a clear procedure on how to manage with the graphical interface git for rust projects. | + | When you create |
- | git commit -m "The message" | + | |
- | git push | + | To connect |
+ | |||
+ | < | ||
+ | git remote add origin < | ||
+ | git push --all origin | ||
</ | </ | ||
+ | |||
+ | You will be prompted for username and password of owner of the Git distant repository. | ||
+ | |||
+ | Edit (Fall 2019) : This actually doesn' | ||
+ | |||
+ | If you want to set all of your branches to automatically use this remote repo when you use git pull, add --set-upstream to the push: | ||
+ | |||
+ | < | ||
+ | git push --all --set-upstream origin | ||
+ | </ | ||
+ | |||
+ | This is the advised way to push to a new repo by Git Lab and works perfectly well with a Rust project. | ||
+ | |||
+ | < | ||
+ | cd existing_folder | ||
+ | git init //Skip if in a Rust project created with cargo, git is already initialized | ||
+ | git remote add origin [Remote Repository Address.git] | ||
+ | git add . //Not sure it's required, since the folder is already populated. | ||
+ | git commit -m " | ||
+ | git push -u origin master //This is what actually pushes. | ||
+ | </ | ||
+ | Atom has a built-in git feature that will automatically detect git repositories and has a useful GUI. To use it, your project root folder **must be directly** in the project tree manager. It cannot be in a sub-directory or Atom will **not** autodetect the git repository. | ||
+ | |||
+ | ===== Ressources ===== | ||
+ | |||
+ | [[https:// |